-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathresize.spec.js
More file actions
60 lines (55 loc) · 2.47 KB
/
resize.spec.js
File metadata and controls
60 lines (55 loc) · 2.47 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/******************************************************************************
*
* Copyright (c) 2017, the Perspective Authors.
*
* This file is part of the Perspective library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
const utils = require("@finos/perspective-test");
const path = require("path");
utils.with_server({}, () => {
describe.page(
"resize.html",
() => {
test.capture(
"Config should show by default",
async page => {
await page.waitForSelector("perspective-viewer:not([updating])");
await page.waitForSelector("perspective-viewer[settings]");
},
{}
);
test.capture(
"Resize the container causes the widget to resize",
async page => {
await page.waitForSelector("perspective-viewer:not([updating])");
await page.evaluate(async () => await document.querySelector("perspective-viewer").toggleConfig());
await page.waitForSelector("perspective-viewer:not([updating])");
await page.evaluate(async () => {
document.querySelector(".PSPContainer").style = "position:absolute;top:0;left:0;width:300px;height:300px";
await document.querySelector("perspective-viewer").notifyResize();
});
await page.evaluate(async () => {
document.querySelector(".PSPContainer").style = "position:absolute;top:0;left:0;width:800px;height:600px";
await document.querySelector("perspective-viewer").notifyResize();
});
},
{}
);
test.capture(
"row_pivots traitlet works",
async page => {
await page.waitForSelector("perspective-viewer:not([updating])");
await page.evaluate(async () => await document.querySelector("perspective-viewer").toggleConfig());
await page.evaluate(() => {
window.__WIDGET__.row_pivots = ["State"];
});
await page.waitForSelector("perspective-viewer:not([updating])");
},
{}
);
},
{root: path.join(__dirname, "..", "..")}
);
});