-
Notifications
You must be signed in to change notification settings - Fork 802
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix uploader not reading multiple property from the input element pro…
…perly, closes #7276
- Loading branch information
1 parent
fd99166
commit bd8f0a7
Showing
4 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Uploader } from "./uploader"; | ||
|
||
describe("Uploader", () => { | ||
it("reads multiple from the input if not passed via options", () => { | ||
const input = <input multiple={true} /> as HTMLInputElement; | ||
const uploader = new Uploader({ | ||
input | ||
}); | ||
expect(uploader["isMultiple"]?.()).toBe(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { UploadHelper } from "./uploadhelper"; | ||
|
||
describe("UploadHelper.addUploadInput", () => { | ||
it("should set inputs multiple attribute to true if options.allowMultiple is true", () => { | ||
const container = document.body.appendChild(<div/>) as HTMLElement; | ||
const input = UploadHelper.addUploadInput({ | ||
container, | ||
inputName: "file", | ||
allowMultiple: true | ||
}); | ||
expect((input.getNode() as HTMLInputElement).multiple).toBe(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters