@atlaskit/editor-plugin-table 5.4.4 → 5.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/cjs/plugins/table/types.js +1 -1
- package/dist/cjs/plugins/table/ui/DragHandle/HandleIconComponent.js +29 -0
- package/dist/cjs/plugins/table/ui/DragHandle/index.js +21 -20
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/ui/consts.js +1 -2
- package/dist/cjs/plugins/table/ui/ui-styles.js +10 -13
- package/dist/cjs/plugins/table/utils/decoration.js +7 -6
- package/dist/es2019/plugins/table/types.js +1 -1
- package/dist/es2019/plugins/table/ui/DragHandle/HandleIconComponent.js +24 -0
- package/dist/es2019/plugins/table/ui/DragHandle/index.js +21 -20
- package/dist/es2019/plugins/table/ui/common-styles.js +6 -2
- package/dist/es2019/plugins/table/ui/consts.js +0 -1
- package/dist/es2019/plugins/table/ui/ui-styles.js +18 -12
- package/dist/es2019/plugins/table/utils/decoration.js +7 -6
- package/dist/esm/plugins/table/types.js +1 -1
- package/dist/esm/plugins/table/ui/DragHandle/HandleIconComponent.js +22 -0
- package/dist/esm/plugins/table/ui/DragHandle/index.js +21 -20
- package/dist/esm/plugins/table/ui/common-styles.js +2 -2
- package/dist/esm/plugins/table/ui/consts.js +0 -1
- package/dist/esm/plugins/table/ui/ui-styles.js +10 -13
- package/dist/esm/plugins/table/utils/decoration.js +7 -6
- package/dist/types/plugins/table/types.d.ts +1 -1
- package/dist/types/plugins/table/ui/DragHandle/HandleIconComponent.d.ts +13 -0
- package/dist/types/plugins/table/ui/consts.d.ts +0 -1
- package/dist/types/plugins/table/ui/ui-styles.d.ts +0 -1
- package/dist/types-ts4.5/plugins/table/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/DragHandle/HandleIconComponent.d.ts +13 -0
- package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +0 -1
- package/dist/types-ts4.5/plugins/table/ui/ui-styles.d.ts +0 -1
- package/package.json +1 -1
- package/src/__tests__/integration/__fixtures__/basic-table.ts +1 -1
- package/src/plugins/table/types.ts +1 -1
- package/src/plugins/table/ui/DragHandle/HandleIconComponent.tsx +51 -0
- package/src/plugins/table/ui/DragHandle/index.tsx +30 -33
- package/src/plugins/table/ui/common-styles.ts +5 -2
- package/src/plugins/table/ui/consts.ts +0 -5
- package/src/plugins/table/ui/ui-styles.ts +17 -12
- package/src/plugins/table/utils/decoration.ts +14 -19
- package/src/__tests__/integration/__fixtures__/large-table-with-sticky-header.ts +0 -2311
- package/src/__tests__/integration/__fixtures__/table-and-paragraph-adf.ts +0 -130
- package/src/__tests__/integration/horizontal-scroll-shadows.ts +0 -197
- package/src/__tests__/integration/meta-arrowup-cursor-in-first-row.ts +0 -42
- package/src/__tests__/integration/sticky-header.ts +0 -133
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
version: 1,
|
|
3
|
-
type: 'doc',
|
|
4
|
-
content: [
|
|
5
|
-
{
|
|
6
|
-
type: 'table',
|
|
7
|
-
attrs: {
|
|
8
|
-
isNumberColumnEnabled: false,
|
|
9
|
-
layout: 'default',
|
|
10
|
-
localId: '79259280-56bc-4cb0-9587-572864b97f39',
|
|
11
|
-
},
|
|
12
|
-
content: [
|
|
13
|
-
{
|
|
14
|
-
type: 'tableRow',
|
|
15
|
-
content: [
|
|
16
|
-
{
|
|
17
|
-
type: 'tableHeader',
|
|
18
|
-
attrs: {},
|
|
19
|
-
content: [
|
|
20
|
-
{
|
|
21
|
-
type: 'paragraph',
|
|
22
|
-
content: [],
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
type: 'tableHeader',
|
|
28
|
-
attrs: {},
|
|
29
|
-
content: [
|
|
30
|
-
{
|
|
31
|
-
type: 'paragraph',
|
|
32
|
-
content: [],
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
type: 'tableHeader',
|
|
38
|
-
attrs: {},
|
|
39
|
-
content: [
|
|
40
|
-
{
|
|
41
|
-
type: 'paragraph',
|
|
42
|
-
content: [],
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
type: 'tableRow',
|
|
50
|
-
content: [
|
|
51
|
-
{
|
|
52
|
-
type: 'tableCell',
|
|
53
|
-
attrs: {},
|
|
54
|
-
content: [
|
|
55
|
-
{
|
|
56
|
-
type: 'paragraph',
|
|
57
|
-
content: [],
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
type: 'tableCell',
|
|
63
|
-
attrs: {},
|
|
64
|
-
content: [
|
|
65
|
-
{
|
|
66
|
-
type: 'paragraph',
|
|
67
|
-
content: [],
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
type: 'tableCell',
|
|
73
|
-
attrs: {},
|
|
74
|
-
content: [
|
|
75
|
-
{
|
|
76
|
-
type: 'paragraph',
|
|
77
|
-
content: [],
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
type: 'tableRow',
|
|
85
|
-
content: [
|
|
86
|
-
{
|
|
87
|
-
type: 'tableCell',
|
|
88
|
-
attrs: {},
|
|
89
|
-
content: [
|
|
90
|
-
{
|
|
91
|
-
type: 'paragraph',
|
|
92
|
-
content: [],
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
type: 'tableCell',
|
|
98
|
-
attrs: {},
|
|
99
|
-
content: [
|
|
100
|
-
{
|
|
101
|
-
type: 'paragraph',
|
|
102
|
-
content: [],
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
type: 'tableCell',
|
|
108
|
-
attrs: {},
|
|
109
|
-
content: [
|
|
110
|
-
{
|
|
111
|
-
type: 'paragraph',
|
|
112
|
-
content: [],
|
|
113
|
-
},
|
|
114
|
-
],
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
type: 'paragraph',
|
|
122
|
-
content: [
|
|
123
|
-
{
|
|
124
|
-
type: 'text',
|
|
125
|
-
text: 'test',
|
|
126
|
-
},
|
|
127
|
-
],
|
|
128
|
-
},
|
|
129
|
-
],
|
|
130
|
-
};
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
2
|
-
import {
|
|
3
|
-
fullpage,
|
|
4
|
-
resizeColumn,
|
|
5
|
-
} from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
6
|
-
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
7
|
-
import {
|
|
8
|
-
goToEditorTestingWDExample,
|
|
9
|
-
mountEditor,
|
|
10
|
-
} from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
11
|
-
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
12
|
-
import type WebdriverPage from '@atlaskit/webdriver-runner/wd-wrapper';
|
|
13
|
-
|
|
14
|
-
import { TableCssClassName as className } from '../../plugins/table/types';
|
|
15
|
-
|
|
16
|
-
import basicTable from './__fixtures__/basic-table';
|
|
17
|
-
|
|
18
|
-
const checkShadows = async (page: WebdriverPage, side?: 'left' | 'right') => {
|
|
19
|
-
const leftShadow = await page.$(`.${className.TABLE_LEFT_SHADOW}`);
|
|
20
|
-
const rightShadow = await page.$(`.${className.TABLE_RIGHT_SHADOW}`);
|
|
21
|
-
|
|
22
|
-
if (!side) {
|
|
23
|
-
const leftDisplayed = await leftShadow.isDisplayed();
|
|
24
|
-
const rightDisplayed = await rightShadow.isDisplayed();
|
|
25
|
-
return leftDisplayed && rightDisplayed;
|
|
26
|
-
} else if (side === 'left') {
|
|
27
|
-
return await leftShadow.isDisplayed();
|
|
28
|
-
} else if (side === 'right') {
|
|
29
|
-
return await rightShadow.isDisplayed();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
BrowserTestCase(
|
|
34
|
-
'Table does not show horizontal scroll shadows when there is no scrollbar',
|
|
35
|
-
{},
|
|
36
|
-
async (client: any, testName: string) => {
|
|
37
|
-
const page = await goToEditorTestingWDExample(
|
|
38
|
-
client,
|
|
39
|
-
'editor-plugin-table',
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
await mountEditor(page, {
|
|
43
|
-
appearance: fullpage.appearance,
|
|
44
|
-
defaultValue: JSON.stringify(basicTable),
|
|
45
|
-
allowTables: {
|
|
46
|
-
advanced: true,
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
await page.waitForSelector('table');
|
|
51
|
-
expect(await checkShadows(page)).toBeFalsy();
|
|
52
|
-
},
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
BrowserTestCase(
|
|
56
|
-
'Table shows right shadow when table is scrollable and all the way to the left',
|
|
57
|
-
{},
|
|
58
|
-
async (client: any, testName: string) => {
|
|
59
|
-
const page = await goToEditorTestingWDExample(
|
|
60
|
-
client,
|
|
61
|
-
'editor-plugin-table',
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
await mountEditor(page, {
|
|
65
|
-
appearance: fullpage.appearance,
|
|
66
|
-
defaultValue: JSON.stringify(basicTable),
|
|
67
|
-
allowTables: {
|
|
68
|
-
advanced: true,
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
await page.waitForSelector('table');
|
|
73
|
-
await resizeColumn(page, { cellHandlePos: 2, resizeWidth: 1000 });
|
|
74
|
-
|
|
75
|
-
expect(await checkShadows(page, 'right')).toBeTruthy();
|
|
76
|
-
},
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
BrowserTestCase(
|
|
80
|
-
'Table should not show left shadow when table is scrollable and all the way to the left',
|
|
81
|
-
{},
|
|
82
|
-
async (client: any, testName: string) => {
|
|
83
|
-
const page = await goToEditorTestingWDExample(
|
|
84
|
-
client,
|
|
85
|
-
'editor-plugin-table',
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
await mountEditor(page, {
|
|
89
|
-
appearance: fullpage.appearance,
|
|
90
|
-
defaultValue: JSON.stringify(basicTable),
|
|
91
|
-
allowTables: {
|
|
92
|
-
advanced: true,
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
await page.waitForSelector('table');
|
|
97
|
-
await resizeColumn(page, { cellHandlePos: 2, resizeWidth: 1000 });
|
|
98
|
-
|
|
99
|
-
expect(await checkShadows(page, 'left')).toBeFalsy();
|
|
100
|
-
},
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
BrowserTestCase(
|
|
104
|
-
'Table should show both left and right shadows when table is scrollable and scrolled',
|
|
105
|
-
{},
|
|
106
|
-
async (client: any, testName: string) => {
|
|
107
|
-
const page = await goToEditorTestingWDExample(
|
|
108
|
-
client,
|
|
109
|
-
'editor-plugin-table',
|
|
110
|
-
);
|
|
111
|
-
|
|
112
|
-
await mountEditor(page, {
|
|
113
|
-
appearance: fullpage.appearance,
|
|
114
|
-
defaultValue: JSON.stringify(basicTable),
|
|
115
|
-
allowTables: {
|
|
116
|
-
advanced: true,
|
|
117
|
-
},
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
await page.waitForSelector('table');
|
|
121
|
-
await resizeColumn(page, { cellHandlePos: 2, resizeWidth: 1000 });
|
|
122
|
-
await page.evaluate(() => {
|
|
123
|
-
const tableWrapper =
|
|
124
|
-
document.querySelector<HTMLElement>('.pm-table-wrapper');
|
|
125
|
-
if (tableWrapper) {
|
|
126
|
-
tableWrapper.scrollLeft += 500;
|
|
127
|
-
}
|
|
128
|
-
return tableWrapper;
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
expect(await checkShadows(page)).toBeTruthy();
|
|
132
|
-
},
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
BrowserTestCase(
|
|
136
|
-
'Table should not show right shadow when table is scrollable and scrolled all the way to the right',
|
|
137
|
-
{},
|
|
138
|
-
async (client: any, testName: string) => {
|
|
139
|
-
const page = await goToEditorTestingWDExample(
|
|
140
|
-
client,
|
|
141
|
-
'editor-plugin-table',
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
await mountEditor(page, {
|
|
145
|
-
appearance: fullpage.appearance,
|
|
146
|
-
defaultValue: JSON.stringify(basicTable),
|
|
147
|
-
allowTables: {
|
|
148
|
-
advanced: true,
|
|
149
|
-
},
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
await page.waitForSelector('table');
|
|
153
|
-
await resizeColumn(page, { cellHandlePos: 2, resizeWidth: 1000 });
|
|
154
|
-
await page.evaluate(() => {
|
|
155
|
-
const tableWrapper =
|
|
156
|
-
document.querySelector<HTMLElement>('.pm-table-wrapper');
|
|
157
|
-
if (tableWrapper) {
|
|
158
|
-
tableWrapper.scrollLeft += 1000;
|
|
159
|
-
}
|
|
160
|
-
return tableWrapper;
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
expect(await checkShadows(page, 'right')).toBeFalsy();
|
|
164
|
-
},
|
|
165
|
-
);
|
|
166
|
-
|
|
167
|
-
BrowserTestCase(
|
|
168
|
-
'Table should show left shadow when table is scrollable and scrolled all the way to the right',
|
|
169
|
-
{},
|
|
170
|
-
async (client: any, testName: string) => {
|
|
171
|
-
const page = await goToEditorTestingWDExample(
|
|
172
|
-
client,
|
|
173
|
-
'editor-plugin-table',
|
|
174
|
-
);
|
|
175
|
-
|
|
176
|
-
await mountEditor(page, {
|
|
177
|
-
appearance: fullpage.appearance,
|
|
178
|
-
defaultValue: JSON.stringify(basicTable),
|
|
179
|
-
allowTables: {
|
|
180
|
-
advanced: true,
|
|
181
|
-
},
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
await page.waitForSelector('table');
|
|
185
|
-
await resizeColumn(page, { cellHandlePos: 2, resizeWidth: 1000 });
|
|
186
|
-
await page.evaluate(() => {
|
|
187
|
-
const tableWrapper =
|
|
188
|
-
document.querySelector<HTMLElement>('.pm-table-wrapper');
|
|
189
|
-
if (tableWrapper) {
|
|
190
|
-
tableWrapper.scrollLeft += 1000;
|
|
191
|
-
}
|
|
192
|
-
return tableWrapper;
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
expect(await checkShadows(page, 'left')).toBeTruthy();
|
|
196
|
-
},
|
|
197
|
-
);
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
2
|
-
import {
|
|
3
|
-
expectToMatchSelection,
|
|
4
|
-
fullpage,
|
|
5
|
-
setProseMirrorTextSelection,
|
|
6
|
-
} from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
7
|
-
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
8
|
-
import {
|
|
9
|
-
goToEditorTestingWDExample,
|
|
10
|
-
mountEditor,
|
|
11
|
-
} from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
12
|
-
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
13
|
-
|
|
14
|
-
import tableAdf from './__fixtures__/table-and-paragraph-adf';
|
|
15
|
-
|
|
16
|
-
BrowserTestCase(
|
|
17
|
-
'meta-arrowup-cursor-in-first-row.ts: pressing command/ctrl + arrow up should move cursor into first row',
|
|
18
|
-
{},
|
|
19
|
-
async (client: any) => {
|
|
20
|
-
const page = await goToEditorTestingWDExample(
|
|
21
|
-
client,
|
|
22
|
-
'editor-plugin-table',
|
|
23
|
-
);
|
|
24
|
-
await mountEditor(page, {
|
|
25
|
-
appearance: fullpage.appearance,
|
|
26
|
-
allowTables: {
|
|
27
|
-
advanced: true,
|
|
28
|
-
},
|
|
29
|
-
defaultValue: tableAdf,
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
await setProseMirrorTextSelection(page, { anchor: 49 });
|
|
33
|
-
|
|
34
|
-
const keys = page.isWindowsPlatform()
|
|
35
|
-
? ['Control', 'Home']
|
|
36
|
-
: ['Meta', 'ArrowUp'];
|
|
37
|
-
|
|
38
|
-
await page.keys(keys, true);
|
|
39
|
-
|
|
40
|
-
await expectToMatchSelection(page, { type: 'text', anchor: 4, head: 4 });
|
|
41
|
-
},
|
|
42
|
-
);
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
2
|
-
import {
|
|
3
|
-
fullpage,
|
|
4
|
-
tableSelectors,
|
|
5
|
-
} from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
6
|
-
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
7
|
-
import {
|
|
8
|
-
goToEditorTestingWDExample,
|
|
9
|
-
mountEditor,
|
|
10
|
-
} from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
11
|
-
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
12
|
-
import type WebdriverPage from '@atlaskit/webdriver-runner/wd-wrapper';
|
|
13
|
-
|
|
14
|
-
import stickyTable from './__fixtures__/large-table-with-sticky-header';
|
|
15
|
-
|
|
16
|
-
const scrollTo = async (page: WebdriverPage, height: number) => {
|
|
17
|
-
const editorScrollParentSelector = '.fabric-editor-popup-scroll-parent';
|
|
18
|
-
await page.execute(
|
|
19
|
-
(editorScrollParentSelector: string, height: number) => {
|
|
20
|
-
const editor = document.querySelector(editorScrollParentSelector);
|
|
21
|
-
editor && editor.scroll(0, height);
|
|
22
|
-
},
|
|
23
|
-
editorScrollParentSelector,
|
|
24
|
-
height,
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
// const resizeScrollParent = async (page: WebdriverPage) => {
|
|
29
|
-
// const editorScrollParentSelector = '.ak-editor-fp-content-area';
|
|
30
|
-
// await page.execute((editorScrollParentSelector: string) => {
|
|
31
|
-
// const editor = document.querySelector(editorScrollParentSelector);
|
|
32
|
-
// console.log('editort', editor);
|
|
33
|
-
// editor && editor.setAttribute('width', '1000px');
|
|
34
|
-
// }, editorScrollParentSelector);
|
|
35
|
-
// };
|
|
36
|
-
|
|
37
|
-
const insertColumn = async (page: any, cell: 'first' | 'last') => {
|
|
38
|
-
const columnControl = tableSelectors.nthColumnControl(1);
|
|
39
|
-
const insertButton = tableSelectors.insertButton;
|
|
40
|
-
const firstCell = tableSelectors.topLeftCell;
|
|
41
|
-
const firstCellLastRow = `table > tbody > tr:nth-child(48) > td:nth-child(1)`;
|
|
42
|
-
|
|
43
|
-
if (cell === 'first') {
|
|
44
|
-
await page.click(firstCell);
|
|
45
|
-
} else if (cell === 'last') {
|
|
46
|
-
await page.click(firstCellLastRow);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const columnDecorationSelector = columnControl;
|
|
50
|
-
await page.hover(columnDecorationSelector);
|
|
51
|
-
|
|
52
|
-
await page.waitForSelector(insertButton);
|
|
53
|
-
await page.click(insertButton);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
BrowserTestCase(
|
|
57
|
-
'Sticky header should correctly toggle on and off',
|
|
58
|
-
{},
|
|
59
|
-
async (client: any, testName: string) => {
|
|
60
|
-
const page = await goToEditorTestingWDExample(
|
|
61
|
-
client,
|
|
62
|
-
'editor-plugin-table',
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
await mountEditor(page, {
|
|
66
|
-
appearance: fullpage.appearance,
|
|
67
|
-
defaultValue: JSON.stringify(stickyTable),
|
|
68
|
-
allowTables: {
|
|
69
|
-
advanced: true,
|
|
70
|
-
stickyHeaders: true,
|
|
71
|
-
},
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
await page.waitForSelector('table');
|
|
75
|
-
|
|
76
|
-
expect(
|
|
77
|
-
await page.waitForSelector(tableSelectors.stickyTable, {}, true),
|
|
78
|
-
).toBeTruthy();
|
|
79
|
-
expect(
|
|
80
|
-
await page.waitForSelector(tableSelectors.stickyTr, {}, true),
|
|
81
|
-
).toBeTruthy();
|
|
82
|
-
|
|
83
|
-
await scrollTo(page, window.innerHeight * 100);
|
|
84
|
-
|
|
85
|
-
expect(await page.waitForSelector(tableSelectors.stickyTable)).toBeTruthy();
|
|
86
|
-
expect(await page.waitForSelector(tableSelectors.stickyTr)).toBeTruthy();
|
|
87
|
-
|
|
88
|
-
await scrollTo(page, 0);
|
|
89
|
-
|
|
90
|
-
expect(
|
|
91
|
-
await page.waitForSelector(tableSelectors.stickyTable, {}, true),
|
|
92
|
-
).toBeTruthy();
|
|
93
|
-
expect(
|
|
94
|
-
await page.waitForSelector(tableSelectors.stickyTr, {}, true),
|
|
95
|
-
).toBeTruthy();
|
|
96
|
-
},
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
BrowserTestCase(
|
|
100
|
-
'Sticky header should still correctly toggle on and off, after a column has been added',
|
|
101
|
-
{ skip: ['safari'] },
|
|
102
|
-
async (client: any, testName: string) => {
|
|
103
|
-
const page = await goToEditorTestingWDExample(
|
|
104
|
-
client,
|
|
105
|
-
'editor-plugin-table',
|
|
106
|
-
);
|
|
107
|
-
|
|
108
|
-
await mountEditor(page, {
|
|
109
|
-
appearance: fullpage.appearance,
|
|
110
|
-
defaultValue: JSON.stringify(stickyTable),
|
|
111
|
-
allowTables: {
|
|
112
|
-
advanced: true,
|
|
113
|
-
stickyHeaders: true,
|
|
114
|
-
},
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
await page.waitForSelector('table');
|
|
118
|
-
|
|
119
|
-
expect(
|
|
120
|
-
await page.waitForSelector(tableSelectors.stickyTable, {}, true),
|
|
121
|
-
).toBeTruthy();
|
|
122
|
-
expect(
|
|
123
|
-
await page.waitForSelector(tableSelectors.stickyTr, {}, true),
|
|
124
|
-
).toBeTruthy();
|
|
125
|
-
|
|
126
|
-
await insertColumn(page, 'first');
|
|
127
|
-
|
|
128
|
-
await scrollTo(page, window.innerHeight * 100);
|
|
129
|
-
|
|
130
|
-
expect(await page.waitForSelector(tableSelectors.stickyTable)).toBeTruthy();
|
|
131
|
-
expect(await page.waitForSelector(tableSelectors.stickyTr)).toBeTruthy();
|
|
132
|
-
},
|
|
133
|
-
);
|