-
Notifications
You must be signed in to change notification settings - Fork 855
/
Copy pathfile.ts
27 lines (25 loc) · 841 Bytes
/
file.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { frameworks, initSurvey, url } from "../helper";
import { ClientFunction, Selector } from "testcafe";
const title = "file";
frameworks.forEach(framework => {
fixture`${framework} ${title}`.page`${url}${framework}`.beforeEach(
async t => {
await initSurvey(framework, {
elements: [
{
type: "file",
name: "q1"
}
]
});
}
);
test("choose file actions readOnly are reactive", async t => {
await t.setFilesToUpload("input[type=file]", "../resources/stub.txt")
.expect(Selector("button[title='Clear']").hasAttribute("disabled")).notOk();
await ClientFunction(() => {
(window as any).survey.getAllQuestions()[0].readOnly = true;
})();
await t.expect(Selector("button[title='Clear']").hasAttribute("disabled")).ok();
});
});