@atlaskit/editor-plugin-table 7.2.2 → 7.2.3
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 +8 -0
- package/dist/cjs/pm-plugins/drag-and-drop/commands-with-analytics.js +3 -19
- package/dist/cjs/utils/drag-menu.js +37 -23
- package/dist/cjs/utils/merged-cells.js +66 -1
- package/dist/es2019/pm-plugins/drag-and-drop/commands-with-analytics.js +4 -20
- package/dist/es2019/utils/drag-menu.js +38 -14
- package/dist/es2019/utils/merged-cells.js +73 -0
- package/dist/esm/pm-plugins/drag-and-drop/commands-with-analytics.js +4 -20
- package/dist/esm/utils/drag-menu.js +36 -22
- package/dist/esm/utils/merged-cells.js +65 -0
- package/dist/types/utils/drag-menu.d.ts +4 -1
- package/dist/types/utils/merged-cells.d.ts +2 -0
- package/dist/types-ts4.5/utils/drag-menu.d.ts +4 -1
- package/dist/types-ts4.5/utils/merged-cells.d.ts +2 -0
- package/package.json +9 -16
- package/src/pm-plugins/drag-and-drop/commands-with-analytics.ts +11 -32
- package/src/utils/drag-menu.ts +94 -20
- package/src/utils/merged-cells.ts +78 -0
- package/tsconfig.dev.json +0 -69
- package/tsconfig.json +2 -877
- package/examples/99-testing.tsx +0 -140
- package/examples/config.jsonc +0 -14
- package/src/__tests__/unit/analytics.ts +0 -888
- package/src/__tests__/unit/collab.ts +0 -93
- package/src/__tests__/unit/commands/go-to-next-cell.ts +0 -173
- package/src/__tests__/unit/commands/insert.ts +0 -137
- package/src/__tests__/unit/commands/misc.ts +0 -185
- package/src/__tests__/unit/commands/sort.ts +0 -128
- package/src/__tests__/unit/commands.ts +0 -745
- package/src/__tests__/unit/copy-button.ts +0 -22
- package/src/__tests__/unit/copy-paste.ts +0 -677
- package/src/__tests__/unit/event-handlers/index.ts +0 -125
- package/src/__tests__/unit/event-handlers.ts +0 -296
- package/src/__tests__/unit/fix-tables.ts +0 -164
- package/src/__tests__/unit/get-toolbar-config.ts +0 -127
- package/src/__tests__/unit/handlers.ts +0 -98
- package/src/__tests__/unit/hover-selection.ts +0 -230
- package/src/__tests__/unit/index-with-fake-timers.ts +0 -111
- package/src/__tests__/unit/index.ts +0 -912
- package/src/__tests__/unit/layout.ts +0 -146
- package/src/__tests__/unit/nodeviews/OverflowShadowsObserver.ts +0 -162
- package/src/__tests__/unit/nodeviews/TableComponent.tsx +0 -280
- package/src/__tests__/unit/nodeviews/TableContainer.tsx +0 -525
- package/src/__tests__/unit/nodeviews/cell.ts +0 -132
- package/src/__tests__/unit/nodeviews/table.ts +0 -129
- package/src/__tests__/unit/pm-plugins/analytics.ts +0 -327
- package/src/__tests__/unit/pm-plugins/decorations/column-controls.ts +0 -94
- package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +0 -176
- package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +0 -211
- package/src/__tests__/unit/pm-plugins/main.ts +0 -214
- package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +0 -101
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +0 -562
- package/src/__tests__/unit/pm-plugins/table-local-id.ts +0 -507
- package/src/__tests__/unit/pm-plugins/table-resizing/colgroup.ts +0 -269
- package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +0 -192
- package/src/__tests__/unit/pm-plugins/table-resizing/utils/resize-state.ts +0 -33
- package/src/__tests__/unit/pm-plugins/table-width.ts +0 -292
- package/src/__tests__/unit/sort-column.ts +0 -399
- package/src/__tests__/unit/toolbar.ts +0 -512
- package/src/__tests__/unit/transforms/delete-columns.ts +0 -597
- package/src/__tests__/unit/transforms/delete-rows.ts +0 -620
- package/src/__tests__/unit/transforms/merging.ts +0 -392
- package/src/__tests__/unit/ui/ContextualMenu.tsx +0 -71
- package/src/__tests__/unit/ui/CornerControls.tsx +0 -99
- package/src/__tests__/unit/ui/DeleteButton.tsx +0 -38
- package/src/__tests__/unit/ui/FixedButton.tsx +0 -217
- package/src/__tests__/unit/ui/FloatingContextualButton.tsx +0 -123
- package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +0 -68
- package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +0 -178
- package/src/__tests__/unit/ui/FloatingDragMenu.tsx +0 -511
- package/src/__tests__/unit/ui/FloatingInsertButton.tsx +0 -322
- package/src/__tests__/unit/ui/NumberColumn.tsx +0 -146
- package/src/__tests__/unit/ui/RowControls.tsx +0 -294
- package/src/__tests__/unit/ui/RowDragControls.tsx +0 -129
- package/src/__tests__/unit/ui/TableFloatingColumnControls.tsx +0 -189
- package/src/__tests__/unit/ui/TableFloatingControls.tsx +0 -118
- package/src/__tests__/unit/undo-redo.ts +0 -220
- package/src/__tests__/unit/utils/analytics.ts +0 -98
- package/src/__tests__/unit/utils/collapse.ts +0 -57
- package/src/__tests__/unit/utils/column-controls.ts +0 -205
- package/src/__tests__/unit/utils/dom.ts +0 -180
- package/src/__tests__/unit/utils/merged-cells.ts +0 -156
- package/src/__tests__/unit/utils/nodes.ts +0 -79
- package/src/__tests__/unit/utils/row-controls.ts +0 -195
- package/src/__tests__/unit/utils/table.ts +0 -96
- package/src/__tests__/unit/utils.ts +0 -670
- package/src/__tests__/visual-regression/__fixtures__/sticky-header-with-horizontal-scroll.json +0 -5228
- package/src/__tests__/visual-regression/__fixtures__/table-with-100-numbered-list-items.json +0 -20272
- package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-column-menu-item-should-remove-the-table-column-on-click-1-snap.png +0 -3
- package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-column-menu-item-visual-hints-should-be-added-to-the-table-column-on-hover-1-snap.png +0 -3
- package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-row-menu-item-should-remove-the-table-row-on-click-1-snap.png +0 -3
- package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-row-menu-item-visual-hints-should-be-added-to-the-table-row-on-hover-1-snap.png +0 -3
- package/src/__tests__/visual-regression/__image_snapshots__/copy-button-ts-floating-toolbar-copy-button-table-target-node-displays-blue-border-when-copy-button-is-hovered-1-snap.png +0 -3
- package/src/__tests__/visual-regression/__image_snapshots__/index-ts-snapshot-test-table-numbered-list-should-not-overflow-table-cell-when-there-are-more-than-100-ordered-list-items-1-snap.png +0 -3
- package/src/__tests__/visual-regression/__image_snapshots__/index-ts-snapshot-test-table-numbered-list-should-not-overflow-table-cell-when-there-are-more-than-100-ordered-list-items-2-snap.png +0 -3
- package/src/__tests__/visual-regression/__image_snapshots__/index-ts-snapshot-test-table-numbered-list-should-not-overflow-table-cell-when-there-are-more-than-100-ordered-list-items-3-snap.png +0 -3
- package/src/__tests__/visual-regression/__image_snapshots__/sticky-header-ts-snapshot-test-table-sticky-header-should-align-with-table-cell-when-active-1-snap.png +0 -3
- package/src/__tests__/visual-regression/__image_snapshots__/sticky-header-ts-snapshot-test-table-sticky-header-should-align-with-table-cell-when-active-2-snap.png +0 -3
- package/src/__tests__/visual-regression/cell-options-menu.ts +0 -101
- package/src/__tests__/visual-regression/copy-button.ts +0 -181
- package/src/__tests__/visual-regression/index.ts +0 -62
- package/src/__tests__/visual-regression/sticky-header.ts +0 -61
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
2
|
-
import { insertTable } from '@atlaskit/editor-test-helpers/page-objects/table';
|
|
3
|
-
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
4
|
-
import {
|
|
5
|
-
initFullPageEditorWithAdf,
|
|
6
|
-
snapshot,
|
|
7
|
-
} from '@atlaskit/editor-test-helpers/vr-utils/base-utils';
|
|
8
|
-
import type { PuppeteerPage } from '@atlaskit/visual-regression/helper';
|
|
9
|
-
|
|
10
|
-
const firstCellSelector = 'table tbody th p';
|
|
11
|
-
const cellOptionsSelector = '[aria-label="Cell options"]';
|
|
12
|
-
const deleteColumnCellOptionSelector = '[aria-label="Delete column"]';
|
|
13
|
-
const deleteRowCellOptionSelector = '[aria-label="Delete row"]';
|
|
14
|
-
|
|
15
|
-
const emptyDocAdf = {
|
|
16
|
-
version: 1,
|
|
17
|
-
type: 'doc',
|
|
18
|
-
content: [],
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
describe('Table cell options menu', () => {
|
|
22
|
-
let page: PuppeteerPage;
|
|
23
|
-
|
|
24
|
-
beforeEach(async () => {
|
|
25
|
-
page = global.page;
|
|
26
|
-
await initFullPageEditorWithAdf(
|
|
27
|
-
page,
|
|
28
|
-
emptyDocAdf,
|
|
29
|
-
undefined,
|
|
30
|
-
undefined,
|
|
31
|
-
{},
|
|
32
|
-
undefined,
|
|
33
|
-
undefined,
|
|
34
|
-
true,
|
|
35
|
-
false,
|
|
36
|
-
undefined,
|
|
37
|
-
{
|
|
38
|
-
group: 'editor',
|
|
39
|
-
packageName: 'editor-plugin-table',
|
|
40
|
-
exampleName: 'testing',
|
|
41
|
-
},
|
|
42
|
-
);
|
|
43
|
-
await insertTable(page);
|
|
44
|
-
page.waitForSelector(firstCellSelector);
|
|
45
|
-
|
|
46
|
-
// move the focus to the first table cell
|
|
47
|
-
await page.type(firstCellSelector, 'focus table cell');
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
describe('delete column menu item', () => {
|
|
51
|
-
it('visual hints should be added to the table column on hover', async () => {
|
|
52
|
-
// open the table cell options menu
|
|
53
|
-
await page.waitForSelector(cellOptionsSelector);
|
|
54
|
-
await page.click(cellOptionsSelector);
|
|
55
|
-
|
|
56
|
-
// hover over the table cell options Delete column entry
|
|
57
|
-
await page.waitForSelector(deleteColumnCellOptionSelector);
|
|
58
|
-
await page.hover(deleteColumnCellOptionSelector);
|
|
59
|
-
|
|
60
|
-
await snapshot(page);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('should remove the table column on click', async () => {
|
|
64
|
-
// open the table cell options menu
|
|
65
|
-
await page.waitForSelector(cellOptionsSelector);
|
|
66
|
-
await page.click(cellOptionsSelector);
|
|
67
|
-
|
|
68
|
-
// click the table cell options Delete column entry
|
|
69
|
-
await page.waitForSelector(deleteColumnCellOptionSelector);
|
|
70
|
-
await page.click(deleteColumnCellOptionSelector);
|
|
71
|
-
|
|
72
|
-
await snapshot(page);
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
describe('delete row menu item', () => {
|
|
77
|
-
it('visual hints should be added to the table row on hover', async () => {
|
|
78
|
-
// open the table cell options menu
|
|
79
|
-
await page.waitForSelector(cellOptionsSelector);
|
|
80
|
-
await page.click(cellOptionsSelector);
|
|
81
|
-
|
|
82
|
-
// hover over the table cell options Delete row entry
|
|
83
|
-
await page.waitForSelector(deleteRowCellOptionSelector);
|
|
84
|
-
await page.hover(deleteRowCellOptionSelector);
|
|
85
|
-
|
|
86
|
-
await snapshot(page);
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it('should remove the table row on click', async () => {
|
|
90
|
-
// open the table cell options menu
|
|
91
|
-
await page.waitForSelector(cellOptionsSelector);
|
|
92
|
-
await page.click(cellOptionsSelector);
|
|
93
|
-
|
|
94
|
-
// click the table cell options Delete row entry
|
|
95
|
-
await page.waitForSelector(deleteColumnCellOptionSelector);
|
|
96
|
-
await page.click(deleteRowCellOptionSelector);
|
|
97
|
-
|
|
98
|
-
await snapshot(page);
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
});
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
|
|
3
|
-
it.skip('TODO: restore vr `packages/editor/editor-plugin-table/src/__tests__/visual-regression/copy-button.ts`', () => {});
|
|
4
|
-
|
|
5
|
-
// import { _getCopyButtonTestSuite } from '../../../copy-button/__tests__/visual-regression/_getCopyButtonTestSuite';
|
|
6
|
-
|
|
7
|
-
// _getCopyButtonTestSuite({
|
|
8
|
-
// nodeName: 'Table',
|
|
9
|
-
// editorOptions: {
|
|
10
|
-
// allowTables: {
|
|
11
|
-
// advanced: true,
|
|
12
|
-
// },
|
|
13
|
-
// defaultValue: {
|
|
14
|
-
// version: 1,
|
|
15
|
-
// type: 'doc',
|
|
16
|
-
// content: [
|
|
17
|
-
// {
|
|
18
|
-
// type: 'table',
|
|
19
|
-
// attrs: {
|
|
20
|
-
// isNumberColumnEnabled: false,
|
|
21
|
-
// layout: 'default',
|
|
22
|
-
// localId: '15804638-b946-4591-b64c-beffe5122733',
|
|
23
|
-
// },
|
|
24
|
-
// content: [
|
|
25
|
-
// {
|
|
26
|
-
// type: 'tableRow',
|
|
27
|
-
// content: [
|
|
28
|
-
// {
|
|
29
|
-
// type: 'tableHeader',
|
|
30
|
-
// attrs: {},
|
|
31
|
-
// content: [
|
|
32
|
-
// {
|
|
33
|
-
// type: 'paragraph',
|
|
34
|
-
// content: [
|
|
35
|
-
// {
|
|
36
|
-
// type: 'text',
|
|
37
|
-
// text: '1',
|
|
38
|
-
// },
|
|
39
|
-
// ],
|
|
40
|
-
// },
|
|
41
|
-
// ],
|
|
42
|
-
// },
|
|
43
|
-
// {
|
|
44
|
-
// type: 'tableHeader',
|
|
45
|
-
// attrs: {},
|
|
46
|
-
// content: [
|
|
47
|
-
// {
|
|
48
|
-
// type: 'paragraph',
|
|
49
|
-
// content: [
|
|
50
|
-
// {
|
|
51
|
-
// type: 'text',
|
|
52
|
-
// text: '2',
|
|
53
|
-
// },
|
|
54
|
-
// ],
|
|
55
|
-
// },
|
|
56
|
-
// ],
|
|
57
|
-
// },
|
|
58
|
-
// {
|
|
59
|
-
// type: 'tableHeader',
|
|
60
|
-
// attrs: {},
|
|
61
|
-
// content: [
|
|
62
|
-
// {
|
|
63
|
-
// type: 'paragraph',
|
|
64
|
-
// content: [
|
|
65
|
-
// {
|
|
66
|
-
// type: 'text',
|
|
67
|
-
// text: '3',
|
|
68
|
-
// },
|
|
69
|
-
// ],
|
|
70
|
-
// },
|
|
71
|
-
// ],
|
|
72
|
-
// },
|
|
73
|
-
// ],
|
|
74
|
-
// },
|
|
75
|
-
// {
|
|
76
|
-
// type: 'tableRow',
|
|
77
|
-
// content: [
|
|
78
|
-
// {
|
|
79
|
-
// type: 'tableCell',
|
|
80
|
-
// attrs: {},
|
|
81
|
-
// content: [
|
|
82
|
-
// {
|
|
83
|
-
// type: 'paragraph',
|
|
84
|
-
// content: [
|
|
85
|
-
// {
|
|
86
|
-
// type: 'text',
|
|
87
|
-
// text: '4',
|
|
88
|
-
// },
|
|
89
|
-
// ],
|
|
90
|
-
// },
|
|
91
|
-
// ],
|
|
92
|
-
// },
|
|
93
|
-
// {
|
|
94
|
-
// type: 'tableCell',
|
|
95
|
-
// attrs: {},
|
|
96
|
-
// content: [
|
|
97
|
-
// {
|
|
98
|
-
// type: 'paragraph',
|
|
99
|
-
// content: [
|
|
100
|
-
// {
|
|
101
|
-
// type: 'text',
|
|
102
|
-
// text: '5',
|
|
103
|
-
// },
|
|
104
|
-
// ],
|
|
105
|
-
// },
|
|
106
|
-
// ],
|
|
107
|
-
// },
|
|
108
|
-
// {
|
|
109
|
-
// type: 'tableCell',
|
|
110
|
-
// attrs: {},
|
|
111
|
-
// content: [
|
|
112
|
-
// {
|
|
113
|
-
// type: 'paragraph',
|
|
114
|
-
// content: [
|
|
115
|
-
// {
|
|
116
|
-
// type: 'text',
|
|
117
|
-
// text: '6',
|
|
118
|
-
// },
|
|
119
|
-
// ],
|
|
120
|
-
// },
|
|
121
|
-
// ],
|
|
122
|
-
// },
|
|
123
|
-
// ],
|
|
124
|
-
// },
|
|
125
|
-
// {
|
|
126
|
-
// type: 'tableRow',
|
|
127
|
-
// content: [
|
|
128
|
-
// {
|
|
129
|
-
// type: 'tableCell',
|
|
130
|
-
// attrs: {},
|
|
131
|
-
// content: [
|
|
132
|
-
// {
|
|
133
|
-
// type: 'paragraph',
|
|
134
|
-
// content: [
|
|
135
|
-
// {
|
|
136
|
-
// type: 'text',
|
|
137
|
-
// text: '7',
|
|
138
|
-
// },
|
|
139
|
-
// ],
|
|
140
|
-
// },
|
|
141
|
-
// ],
|
|
142
|
-
// },
|
|
143
|
-
// {
|
|
144
|
-
// type: 'tableCell',
|
|
145
|
-
// attrs: {},
|
|
146
|
-
// content: [
|
|
147
|
-
// {
|
|
148
|
-
// type: 'paragraph',
|
|
149
|
-
// content: [
|
|
150
|
-
// {
|
|
151
|
-
// type: 'text',
|
|
152
|
-
// text: '8',
|
|
153
|
-
// },
|
|
154
|
-
// ],
|
|
155
|
-
// },
|
|
156
|
-
// ],
|
|
157
|
-
// },
|
|
158
|
-
// {
|
|
159
|
-
// type: 'tableCell',
|
|
160
|
-
// attrs: {},
|
|
161
|
-
// content: [
|
|
162
|
-
// {
|
|
163
|
-
// type: 'paragraph',
|
|
164
|
-
// content: [
|
|
165
|
-
// {
|
|
166
|
-
// type: 'text',
|
|
167
|
-
// text: '9',
|
|
168
|
-
// },
|
|
169
|
-
// ],
|
|
170
|
-
// },
|
|
171
|
-
// ],
|
|
172
|
-
// },
|
|
173
|
-
// ],
|
|
174
|
-
// },
|
|
175
|
-
// ],
|
|
176
|
-
// },
|
|
177
|
-
// ],
|
|
178
|
-
// },
|
|
179
|
-
// },
|
|
180
|
-
// nodeSelector: '.pm-table-cell-content-wrap',
|
|
181
|
-
// });
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
2
|
-
import {
|
|
3
|
-
scrollToBottom,
|
|
4
|
-
scrollToElement,
|
|
5
|
-
} from '@atlaskit/editor-test-helpers/page-objects/editor';
|
|
6
|
-
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
7
|
-
import {
|
|
8
|
-
initFullPageEditorWithAdf,
|
|
9
|
-
snapshot,
|
|
10
|
-
} from '@atlaskit/editor-test-helpers/vr-utils/base-utils';
|
|
11
|
-
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
12
|
-
import { Device } from '@atlaskit/editor-test-helpers/vr-utils/device-viewport';
|
|
13
|
-
import type { PuppeteerPage } from '@atlaskit/visual-regression/helper';
|
|
14
|
-
|
|
15
|
-
import tableWith100ListItemsADF from './__fixtures__/table-with-100-numbered-list-items.json';
|
|
16
|
-
|
|
17
|
-
async function initEditor(page: PuppeteerPage, adf: Object) {
|
|
18
|
-
await initFullPageEditorWithAdf(
|
|
19
|
-
page,
|
|
20
|
-
adf,
|
|
21
|
-
Device.LaptopMDPI,
|
|
22
|
-
undefined,
|
|
23
|
-
{},
|
|
24
|
-
undefined,
|
|
25
|
-
undefined,
|
|
26
|
-
true,
|
|
27
|
-
false,
|
|
28
|
-
undefined,
|
|
29
|
-
{
|
|
30
|
-
group: 'editor',
|
|
31
|
-
packageName: 'editor-plugin-table',
|
|
32
|
-
exampleName: 'testing',
|
|
33
|
-
},
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
describe('Snapshot Test: Table', () => {
|
|
38
|
-
let page: PuppeteerPage;
|
|
39
|
-
|
|
40
|
-
beforeAll(async () => {
|
|
41
|
-
page = global.page;
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
describe('numbered list', () => {
|
|
45
|
-
// FIXME: Skipping this test as it is flaky
|
|
46
|
-
// Build link: https://bitbucket.org/atlassian/atlassian-frontend/pipelines/results/2289567
|
|
47
|
-
it.skip('should not overflow table cell, when there are more than 100 ordered list items', async () => {
|
|
48
|
-
await initEditor(page, tableWith100ListItemsADF);
|
|
49
|
-
|
|
50
|
-
// initial elements
|
|
51
|
-
await snapshot(page);
|
|
52
|
-
|
|
53
|
-
// 100th elements
|
|
54
|
-
await scrollToElement(page, 'ol > li:nth-of-type(120)');
|
|
55
|
-
await snapshot(page);
|
|
56
|
-
|
|
57
|
-
// 1000th elements
|
|
58
|
-
await scrollToBottom(page);
|
|
59
|
-
await snapshot(page);
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
2
|
-
import { scrollToElement } from '@atlaskit/editor-test-helpers/page-objects/editor';
|
|
3
|
-
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
4
|
-
import { clickFirstCell } from '@atlaskit/editor-test-helpers/page-objects/table';
|
|
5
|
-
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
6
|
-
import {
|
|
7
|
-
Appearance,
|
|
8
|
-
initEditorWithAdf,
|
|
9
|
-
snapshot,
|
|
10
|
-
} from '@atlaskit/editor-test-helpers/vr-utils/base-utils';
|
|
11
|
-
import type { PuppeteerPage } from '@atlaskit/visual-regression/helper';
|
|
12
|
-
|
|
13
|
-
import stickyHeaderWithHorizontalScroll from './__fixtures__/sticky-header-with-horizontal-scroll.json';
|
|
14
|
-
|
|
15
|
-
const initEditor = async (page: PuppeteerPage, adf: any) => {
|
|
16
|
-
await initEditorWithAdf(
|
|
17
|
-
page,
|
|
18
|
-
{
|
|
19
|
-
appearance: Appearance.fullPage,
|
|
20
|
-
adf,
|
|
21
|
-
viewport: { width: 1280, height: 868 },
|
|
22
|
-
editorProps: {
|
|
23
|
-
allowTables: {
|
|
24
|
-
stickyHeaders: true,
|
|
25
|
-
allowColumnResizing: true,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
group: 'editor',
|
|
31
|
-
packageName: 'editor-plugin-table',
|
|
32
|
-
exampleName: 'testing',
|
|
33
|
-
},
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
describe('Snapshot Test: Table', () => {
|
|
38
|
-
let page: PuppeteerPage;
|
|
39
|
-
|
|
40
|
-
beforeEach(async () => {
|
|
41
|
-
page = global.page;
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
describe('sticky header', () => {
|
|
45
|
-
it('should align with table cell when active', async () => {
|
|
46
|
-
await initEditor(page, stickyHeaderWithHorizontalScroll);
|
|
47
|
-
|
|
48
|
-
await clickFirstCell(page, true);
|
|
49
|
-
// Mouse was inside the table and would cause the column resizer to trigger occasionally
|
|
50
|
-
await page.mouse.move(0, 0);
|
|
51
|
-
|
|
52
|
-
// scroll to bottom center to see scroll shadows
|
|
53
|
-
await scrollToElement(page, 'ol > li');
|
|
54
|
-
await snapshot(page);
|
|
55
|
-
|
|
56
|
-
// scroll to bottom right
|
|
57
|
-
await scrollToElement(page, 'ul > li');
|
|
58
|
-
await snapshot(page);
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
});
|