@atlaskit/editor-plugin-table 7.2.2 → 7.3.0

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.
Files changed (149) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/commands/column-resize.js +115 -45
  3. package/dist/cjs/commands/go-to-next-cell.js +7 -11
  4. package/dist/cjs/commands/misc.js +3 -2
  5. package/dist/cjs/commands/selection.js +3 -3
  6. package/dist/cjs/event-handlers.js +38 -25
  7. package/dist/cjs/pm-plugins/drag-and-drop/commands-with-analytics.js +3 -19
  8. package/dist/cjs/pm-plugins/keymap.js +1 -0
  9. package/dist/cjs/pm-plugins/main.js +43 -9
  10. package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +37 -7
  11. package/dist/cjs/pm-plugins/table-resizing/plugin.js +20 -6
  12. package/dist/cjs/reducer.js +5 -2
  13. package/dist/cjs/utils/drag-menu.js +37 -23
  14. package/dist/cjs/utils/merged-cells.js +66 -1
  15. package/dist/es2019/commands/column-resize.js +100 -35
  16. package/dist/es2019/commands/go-to-next-cell.js +7 -9
  17. package/dist/es2019/commands/misc.js +3 -2
  18. package/dist/es2019/commands/selection.js +5 -5
  19. package/dist/es2019/event-handlers.js +17 -3
  20. package/dist/es2019/pm-plugins/drag-and-drop/commands-with-analytics.js +4 -20
  21. package/dist/es2019/pm-plugins/keymap.js +3 -2
  22. package/dist/es2019/pm-plugins/main.js +41 -5
  23. package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +37 -4
  24. package/dist/es2019/pm-plugins/table-resizing/plugin.js +16 -1
  25. package/dist/es2019/reducer.js +5 -2
  26. package/dist/es2019/utils/drag-menu.js +38 -14
  27. package/dist/es2019/utils/merged-cells.js +73 -0
  28. package/dist/esm/commands/column-resize.js +105 -35
  29. package/dist/esm/commands/go-to-next-cell.js +7 -11
  30. package/dist/esm/commands/misc.js +3 -2
  31. package/dist/esm/commands/selection.js +5 -5
  32. package/dist/esm/event-handlers.js +38 -25
  33. package/dist/esm/pm-plugins/drag-and-drop/commands-with-analytics.js +4 -20
  34. package/dist/esm/pm-plugins/keymap.js +3 -2
  35. package/dist/esm/pm-plugins/main.js +38 -4
  36. package/dist/esm/pm-plugins/table-resizing/event-handlers.js +34 -4
  37. package/dist/esm/pm-plugins/table-resizing/plugin.js +15 -1
  38. package/dist/esm/reducer.js +5 -2
  39. package/dist/esm/utils/drag-menu.js +36 -22
  40. package/dist/esm/utils/merged-cells.js +65 -0
  41. package/dist/types/commands/column-resize.d.ts +2 -0
  42. package/dist/types/commands/misc.d.ts +1 -1
  43. package/dist/types/types.d.ts +16 -0
  44. package/dist/types/utils/drag-menu.d.ts +4 -1
  45. package/dist/types/utils/merged-cells.d.ts +2 -0
  46. package/dist/types-ts4.5/commands/column-resize.d.ts +2 -0
  47. package/dist/types-ts4.5/commands/misc.d.ts +1 -1
  48. package/dist/types-ts4.5/types.d.ts +16 -0
  49. package/dist/types-ts4.5/utils/drag-menu.d.ts +4 -1
  50. package/dist/types-ts4.5/utils/merged-cells.d.ts +2 -0
  51. package/package.json +10 -17
  52. package/src/commands/column-resize.ts +155 -40
  53. package/src/commands/go-to-next-cell.ts +6 -15
  54. package/src/commands/misc.ts +2 -0
  55. package/src/commands/selection.ts +5 -5
  56. package/src/event-handlers.ts +21 -4
  57. package/src/pm-plugins/drag-and-drop/commands-with-analytics.ts +11 -32
  58. package/src/pm-plugins/keymap.ts +3 -0
  59. package/src/pm-plugins/main.ts +47 -2
  60. package/src/pm-plugins/table-resizing/event-handlers.ts +33 -5
  61. package/src/pm-plugins/table-resizing/plugin.ts +18 -1
  62. package/src/reducer.ts +5 -2
  63. package/src/types.ts +16 -0
  64. package/src/utils/drag-menu.ts +94 -20
  65. package/src/utils/merged-cells.ts +78 -0
  66. package/tsconfig.dev.json +0 -69
  67. package/tsconfig.json +2 -877
  68. package/examples/99-testing.tsx +0 -140
  69. package/examples/config.jsonc +0 -14
  70. package/src/__tests__/unit/analytics.ts +0 -888
  71. package/src/__tests__/unit/collab.ts +0 -93
  72. package/src/__tests__/unit/commands/go-to-next-cell.ts +0 -173
  73. package/src/__tests__/unit/commands/insert.ts +0 -137
  74. package/src/__tests__/unit/commands/misc.ts +0 -185
  75. package/src/__tests__/unit/commands/sort.ts +0 -128
  76. package/src/__tests__/unit/commands.ts +0 -745
  77. package/src/__tests__/unit/copy-button.ts +0 -22
  78. package/src/__tests__/unit/copy-paste.ts +0 -677
  79. package/src/__tests__/unit/event-handlers/index.ts +0 -125
  80. package/src/__tests__/unit/event-handlers.ts +0 -296
  81. package/src/__tests__/unit/fix-tables.ts +0 -164
  82. package/src/__tests__/unit/get-toolbar-config.ts +0 -127
  83. package/src/__tests__/unit/handlers.ts +0 -98
  84. package/src/__tests__/unit/hover-selection.ts +0 -230
  85. package/src/__tests__/unit/index-with-fake-timers.ts +0 -111
  86. package/src/__tests__/unit/index.ts +0 -912
  87. package/src/__tests__/unit/layout.ts +0 -146
  88. package/src/__tests__/unit/nodeviews/OverflowShadowsObserver.ts +0 -162
  89. package/src/__tests__/unit/nodeviews/TableComponent.tsx +0 -280
  90. package/src/__tests__/unit/nodeviews/TableContainer.tsx +0 -525
  91. package/src/__tests__/unit/nodeviews/cell.ts +0 -132
  92. package/src/__tests__/unit/nodeviews/table.ts +0 -129
  93. package/src/__tests__/unit/pm-plugins/analytics.ts +0 -327
  94. package/src/__tests__/unit/pm-plugins/decorations/column-controls.ts +0 -94
  95. package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +0 -176
  96. package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +0 -211
  97. package/src/__tests__/unit/pm-plugins/main.ts +0 -214
  98. package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +0 -101
  99. package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +0 -562
  100. package/src/__tests__/unit/pm-plugins/table-local-id.ts +0 -507
  101. package/src/__tests__/unit/pm-plugins/table-resizing/colgroup.ts +0 -269
  102. package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +0 -192
  103. package/src/__tests__/unit/pm-plugins/table-resizing/utils/resize-state.ts +0 -33
  104. package/src/__tests__/unit/pm-plugins/table-width.ts +0 -292
  105. package/src/__tests__/unit/sort-column.ts +0 -399
  106. package/src/__tests__/unit/toolbar.ts +0 -512
  107. package/src/__tests__/unit/transforms/delete-columns.ts +0 -597
  108. package/src/__tests__/unit/transforms/delete-rows.ts +0 -620
  109. package/src/__tests__/unit/transforms/merging.ts +0 -392
  110. package/src/__tests__/unit/ui/ContextualMenu.tsx +0 -71
  111. package/src/__tests__/unit/ui/CornerControls.tsx +0 -99
  112. package/src/__tests__/unit/ui/DeleteButton.tsx +0 -38
  113. package/src/__tests__/unit/ui/FixedButton.tsx +0 -217
  114. package/src/__tests__/unit/ui/FloatingContextualButton.tsx +0 -123
  115. package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +0 -68
  116. package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +0 -178
  117. package/src/__tests__/unit/ui/FloatingDragMenu.tsx +0 -511
  118. package/src/__tests__/unit/ui/FloatingInsertButton.tsx +0 -322
  119. package/src/__tests__/unit/ui/NumberColumn.tsx +0 -146
  120. package/src/__tests__/unit/ui/RowControls.tsx +0 -294
  121. package/src/__tests__/unit/ui/RowDragControls.tsx +0 -129
  122. package/src/__tests__/unit/ui/TableFloatingColumnControls.tsx +0 -189
  123. package/src/__tests__/unit/ui/TableFloatingControls.tsx +0 -118
  124. package/src/__tests__/unit/undo-redo.ts +0 -220
  125. package/src/__tests__/unit/utils/analytics.ts +0 -98
  126. package/src/__tests__/unit/utils/collapse.ts +0 -57
  127. package/src/__tests__/unit/utils/column-controls.ts +0 -205
  128. package/src/__tests__/unit/utils/dom.ts +0 -180
  129. package/src/__tests__/unit/utils/merged-cells.ts +0 -156
  130. package/src/__tests__/unit/utils/nodes.ts +0 -79
  131. package/src/__tests__/unit/utils/row-controls.ts +0 -195
  132. package/src/__tests__/unit/utils/table.ts +0 -96
  133. package/src/__tests__/unit/utils.ts +0 -670
  134. package/src/__tests__/visual-regression/__fixtures__/sticky-header-with-horizontal-scroll.json +0 -5228
  135. package/src/__tests__/visual-regression/__fixtures__/table-with-100-numbered-list-items.json +0 -20272
  136. 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
  137. 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
  138. 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
  139. 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
  140. 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
  141. 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
  142. 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
  143. 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
  144. 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
  145. 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
  146. package/src/__tests__/visual-regression/cell-options-menu.ts +0 -101
  147. package/src/__tests__/visual-regression/copy-button.ts +0 -181
  148. package/src/__tests__/visual-regression/index.ts +0 -62
  149. package/src/__tests__/visual-regression/sticky-header.ts +0 -61
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:d1582b4c954f4ba9c81075284aa48ca466d712d2b3eefd5523de473a00b07cb8
3
- size 15412
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:50e4dd203bd2f40435517d45f06576978ae62076f1c94e635323ca6025b2bc18
3
- size 33063
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:564ceae63b3eeb8ba43f3a1dec9245df2ed74397b58209c78970139d73747e15
3
- size 15332
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:b6b00fe5974e24a0b66a3f2e4b61bbb6b776daa6996e89d942b4d2b37fa5b7f8
3
- size 33109
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:e7a36445c9b8e700ee0d8e54eac5975ad2a0cafebc8cdf1202e7d2048363c4d9
3
- size 16964
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:cd8e2c95766f1e96a0cfbf489e2e245a668e3f1f6fa5d2c31d8e96fdf6985470
3
- size 36160
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:184672baa2f0310a00eb5720e0ef9656917b50e6777285039f649c9277f37ecf
3
- size 34670
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f5c7da08c9289a8dd0b2311a705a8ca16234efe58c7519167826805c694aa937
3
- size 42951
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:9572ae92d83265064e906f6413efa2b4290988f90ef39a8b4839d6f0638024b5
3
- size 22041
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:7854cb7000b2220a6f4d4e03e581158c2170947f6c038eb037a2d7d13dd3db2b
3
- size 21239
@@ -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
- });