-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathsuperstore.spec.js
More file actions
64 lines (56 loc) · 2.77 KB
/
superstore.spec.js
File metadata and controls
64 lines (56 loc) · 2.77 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
61
62
63
64
/******************************************************************************
*
* 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("@jpmorganchase/perspective-viewer/test/js/utils.js");
const simple_tests = require("@jpmorganchase/perspective-viewer/test/js/simple_tests.js");
async function set_lazy(page) {
const viewer = await page.$("perspective-viewer");
await page.evaluate(element => {
element.hypergrid.properties.repaintIntervalRate = 1;
Object.defineProperty(element.hypergrid, "_lazy_load", {
set: () => {},
get: () => true
});
}, viewer);
}
utils.with_server({}, () => {
describe.page("superstore.html", () => {
simple_tests.default();
describe("expand/collapse", () => {
test.capture("collapses to depth smaller than viewport", async page => {
const viewer = await page.$("perspective-viewer");
await page.evaluate(element => element.setAttribute("row-pivots", '["Category","State"]'), viewer);
await page.waitForSelector("perspective-viewer:not([updating])");
await page.evaluate(element => {
element.view.set_depth(0);
element.notifyResize();
}, viewer);
await page.waitForSelector("perspective-viewer:not([updating])");
});
});
describe("lazy render mode", () => {
test.capture("resets viewable area when the logical size expands.", async page => {
await set_lazy(page);
await page.click("#config_button");
const viewer = await page.$("perspective-viewer");
await page.evaluate(element => element.setAttribute("column-pivots", '["Category"]'), viewer);
await page.waitForSelector("perspective-viewer:not([updating])");
await page.evaluate(element => element.setAttribute("row-pivots", '["City"]'), viewer);
});
test.capture("resets viewable area when the physical size expands.", async page => {
await set_lazy(page);
await page.click("#config_button");
const viewer = await page.$("perspective-viewer");
await page.evaluate(element => element.setAttribute("row-pivots", '["Category"]'), viewer);
await page.waitForSelector("perspective-viewer:not([updating])");
await page.evaluate(element => element.setAttribute("row-pivots", "[]"), viewer);
await page.click("#config_button");
});
});
});
});