|
1 | | -/// <reference types="Cypress" /> |
2 | | - |
3 | | -import { moveGutter, checkSplitDirAndSizes } from '../support/splitUtils' |
4 | | - |
5 | | - |
6 | | -context('Simple split example page tests', () => { |
7 | | - const W = 1070; |
8 | | - const H = 300; |
9 | | - const GUTTER = 11; |
10 | | - |
11 | | - beforeEach(() => { |
12 | | - cy.visit('/#/examples/simple-split') |
13 | | - }) |
14 | | - |
15 | | - it('Display initial state', () => { |
16 | | - checkSplitDirAndSizes('.ex-percent > as-split', 'horizontal', W, H, GUTTER, [317.6875, 741.296875]); |
17 | | - checkSplitDirAndSizes('.ex-pixel > as-split', 'horizontal', W, H, GUTTER, [120, 768, 160]); |
18 | | - }) |
19 | | - |
20 | | - it('Change direction', () => { |
21 | | - cy.get('.btns > .btn').click(); |
22 | | - |
23 | | - checkSplitDirAndSizes('.ex-percent > as-split', 'vertical', W, H, GUTTER, [86.6875, 202.296875]); |
24 | | - checkSplitDirAndSizes('.ex-pixel > as-split', 'vertical', W, H, GUTTER, [120, 0, 160]); |
25 | | - }) |
26 | | - |
27 | | - it('Move gutter horizontally', () => { |
28 | | - moveGutter('.ex-percent .as-split-gutter', 0, 280, 0); |
29 | | - checkSplitDirAndSizes('.ex-percent > as-split', 'horizontal', W, H, GUTTER, [597.703125, 461.28125]); |
30 | | - |
31 | | - moveGutter('.ex-pixel .as-split-gutter', 0, 280, 0); |
32 | | - checkSplitDirAndSizes('.ex-pixel > as-split', 'horizontal', W, H, GUTTER, [400, 488, 160]); |
33 | | - }) |
34 | | - |
35 | | - it('Change direction & move gutter vertically', () => { |
36 | | - cy.get('.btns > .btn').click(); |
37 | | - |
38 | | - moveGutter('.ex-percent .as-split-gutter', 0, 0, 60); |
39 | | - checkSplitDirAndSizes('.ex-percent > as-split', 'vertical', W, H, GUTTER, [146.6875, 142.296875]); |
40 | | - |
41 | | - moveGutter('.ex-pixel .as-split-gutter', 0, 0, 60); |
42 | | - checkSplitDirAndSizes('.ex-pixel > as-split', 'vertical', W, H, GUTTER, [180, 0, 100]); |
43 | | - }) |
44 | | - |
45 | | - it('Move gutter horizontally and move it back', () => { |
46 | | - moveGutter('.ex-percent .as-split-gutter', 0, 280, 0); |
47 | | - checkSplitDirAndSizes('.ex-percent > as-split', 'horizontal', W, H, GUTTER, [597.703125, 461.28125]); |
48 | | - |
49 | | - moveGutter('.ex-percent .as-split-gutter', 0, -280, 0); |
50 | | - checkSplitDirAndSizes('.ex-percent > as-split', 'horizontal', W, H, GUTTER, [317.71875, 741.265625]); |
51 | | - |
52 | | - moveGutter('.ex-pixel .as-split-gutter', 0, 280, 0); |
53 | | - checkSplitDirAndSizes('.ex-pixel > as-split', 'horizontal', W, H, GUTTER, [400, 488, 160]); |
54 | | - |
55 | | - moveGutter('.ex-pixel .as-split-gutter', 0, -280, 0); |
56 | | - checkSplitDirAndSizes('.ex-pixel > as-split', 'horizontal', W, H, GUTTER, [120, 768, 160]); |
57 | | - }) |
58 | | - |
59 | | - it('Move gutter horizontally to max, change direction', () => { |
60 | | - moveGutter('.ex-percent .as-split-gutter', 0, -1000, 0); |
61 | | - checkSplitDirAndSizes('.ex-percent > as-split', 'horizontal', W, H, GUTTER, [0, 1059]); |
62 | | - |
63 | | - moveGutter('.ex-pixel .as-split-gutter', 0, -1000, 0); |
64 | | - checkSplitDirAndSizes('.ex-pixel > as-split', 'horizontal', W, H, GUTTER, [0, 888, 160]); |
65 | | - |
66 | | - cy.get('.btns > .btn').click(); |
67 | | - |
68 | | - checkSplitDirAndSizes('.ex-percent > as-split', 'vertical', W, H, GUTTER, [0, 289]); |
69 | | - moveGutter('.ex-percent .as-split-gutter', 0, 0, 1000); |
70 | | - |
71 | | - checkSplitDirAndSizes('.ex-pixel > as-split', 'vertical', W, H, GUTTER, [0, 118, 160]); |
72 | | - moveGutter('.ex-pixel .as-split-gutter', 0, 0, 1000); |
73 | | - |
74 | | - cy.get('.btns > .btn').click(); |
75 | | - |
76 | | - checkSplitDirAndSizes('.ex-percent > as-split', 'horizontal', W, H, GUTTER, [1059, 0]); |
77 | | - checkSplitDirAndSizes('.ex-pixel > as-split', 'horizontal', W, H, GUTTER, [278, 770, 0]); |
78 | | - }) |
79 | | -}) |
| 1 | +/// <reference types="Cypress" /> |
| 2 | + |
| 3 | +import { moveGutter, checkSplitDirAndSizes } from '../support/splitUtils' |
| 4 | + |
| 5 | +context('Simple split example page tests', () => { |
| 6 | + const W = 1070 |
| 7 | + const H = 300 |
| 8 | + const GUTTER = 11 |
| 9 | + |
| 10 | + beforeEach(() => { |
| 11 | + cy.visit('/#/examples/simple-split') |
| 12 | + }) |
| 13 | + |
| 14 | + it('Display initial state', () => { |
| 15 | + checkSplitDirAndSizes('.ex-percent > as-split', 'horizontal', W, H, GUTTER, [317.6875, 741.296875]) |
| 16 | + checkSplitDirAndSizes('.ex-pixel > as-split', 'horizontal', W, H, GUTTER, [120, 768, 160]) |
| 17 | + }) |
| 18 | + |
| 19 | + it('Change direction', () => { |
| 20 | + cy.get('.btns > .btn').click() |
| 21 | + |
| 22 | + checkSplitDirAndSizes('.ex-percent > as-split', 'vertical', W, H, GUTTER, [86.6875, 202.296875]) |
| 23 | + checkSplitDirAndSizes('.ex-pixel > as-split', 'vertical', W, H, GUTTER, [120, 0, 160]) |
| 24 | + }) |
| 25 | + |
| 26 | + it('Move gutter horizontally', () => { |
| 27 | + moveGutter('.ex-percent .as-split-gutter', 0, 280, 0) |
| 28 | + checkSplitDirAndSizes('.ex-percent > as-split', 'horizontal', W, H, GUTTER, [597.703125, 461.28125]) |
| 29 | + |
| 30 | + moveGutter('.ex-pixel .as-split-gutter', 0, 280, 0) |
| 31 | + checkSplitDirAndSizes('.ex-pixel > as-split', 'horizontal', W, H, GUTTER, [400, 488, 160]) |
| 32 | + }) |
| 33 | + |
| 34 | + it('Change direction & move gutter vertically', () => { |
| 35 | + cy.get('.btns > .btn').click() |
| 36 | + |
| 37 | + moveGutter('.ex-percent .as-split-gutter', 0, 0, 60) |
| 38 | + checkSplitDirAndSizes('.ex-percent > as-split', 'vertical', W, H, GUTTER, [146.6875, 142.296875]) |
| 39 | + |
| 40 | + moveGutter('.ex-pixel .as-split-gutter', 0, 0, 60) |
| 41 | + checkSplitDirAndSizes('.ex-pixel > as-split', 'vertical', W, H, GUTTER, [180, 0, 100]) |
| 42 | + }) |
| 43 | + |
| 44 | + it('Move gutter horizontally and move it back', () => { |
| 45 | + moveGutter('.ex-percent .as-split-gutter', 0, 280, 0) |
| 46 | + checkSplitDirAndSizes('.ex-percent > as-split', 'horizontal', W, H, GUTTER, [597.703125, 461.28125]) |
| 47 | + |
| 48 | + moveGutter('.ex-percent .as-split-gutter', 0, -280, 0) |
| 49 | + checkSplitDirAndSizes('.ex-percent > as-split', 'horizontal', W, H, GUTTER, [317.71875, 741.265625]) |
| 50 | + |
| 51 | + moveGutter('.ex-pixel .as-split-gutter', 0, 280, 0) |
| 52 | + checkSplitDirAndSizes('.ex-pixel > as-split', 'horizontal', W, H, GUTTER, [400, 488, 160]) |
| 53 | + |
| 54 | + moveGutter('.ex-pixel .as-split-gutter', 0, -280, 0) |
| 55 | + checkSplitDirAndSizes('.ex-pixel > as-split', 'horizontal', W, H, GUTTER, [120, 768, 160]) |
| 56 | + }) |
| 57 | + |
| 58 | + it('Move gutter horizontally to max, change direction', () => { |
| 59 | + moveGutter('.ex-percent .as-split-gutter', 0, -1000, 0) |
| 60 | + checkSplitDirAndSizes('.ex-percent > as-split', 'horizontal', W, H, GUTTER, [0, 1059]) |
| 61 | + |
| 62 | + moveGutter('.ex-pixel .as-split-gutter', 0, -1000, 0) |
| 63 | + checkSplitDirAndSizes('.ex-pixel > as-split', 'horizontal', W, H, GUTTER, [0, 888, 160]) |
| 64 | + |
| 65 | + cy.get('.btns > .btn').click() |
| 66 | + |
| 67 | + checkSplitDirAndSizes('.ex-percent > as-split', 'vertical', W, H, GUTTER, [0, 289]) |
| 68 | + moveGutter('.ex-percent .as-split-gutter', 0, 0, 1000) |
| 69 | + |
| 70 | + checkSplitDirAndSizes('.ex-pixel > as-split', 'vertical', W, H, GUTTER, [0, 118, 160]) |
| 71 | + moveGutter('.ex-pixel .as-split-gutter', 0, 0, 1000) |
| 72 | + |
| 73 | + cy.get('.btns > .btn').click() |
| 74 | + |
| 75 | + checkSplitDirAndSizes('.ex-percent > as-split', 'horizontal', W, H, GUTTER, [1059, 0]) |
| 76 | + checkSplitDirAndSizes('.ex-pixel > as-split', 'horizontal', W, H, GUTTER, [278, 770, 0]) |
| 77 | + }) |
| 78 | +}) |
0 commit comments