@atlaskit/editor-plugin-table 0.0.1 → 0.0.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 +12 -0
- package/dist/cjs/plugins/table/index.js +42 -15
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/index.js +287 -255
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +2 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/index.js +41 -15
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/index.d.ts +1 -2
- package/dist/types-ts4.0/index.d.ts +1 -0
- package/dist/types-ts4.0/plugins/plugin-key.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/commands/clear.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/commands/collapse.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/commands/go-to-next-cell.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/commands/hover.d.ts +8 -0
- package/dist/types-ts4.0/plugins/table/commands/index.d.ts +7 -0
- package/dist/types-ts4.0/plugins/table/commands/insert.d.ts +10 -0
- package/dist/types-ts4.0/plugins/table/commands/misc.d.ts +27 -0
- package/dist/types-ts4.0/plugins/table/commands/selection.d.ts +8 -0
- package/dist/types-ts4.0/plugins/table/commands/sort.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/commands/split-cell.d.ts +6 -0
- package/dist/types-ts4.0/plugins/table/commands/toggle.d.ts +12 -0
- package/dist/types-ts4.0/plugins/table/commands-with-analytics.d.ts +26 -0
- package/dist/types-ts4.0/plugins/table/create-plugin-config.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/event-handlers.d.ts +16 -0
- package/dist/types-ts4.0/plugins/table/handlers.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/index.d.ts +17 -0
- package/dist/types-ts4.0/plugins/table/nodeviews/OverflowShadowsObserver.d.ts +26 -0
- package/dist/types-ts4.0/plugins/table/nodeviews/TableComponent.d.ts +72 -0
- package/dist/types-ts4.0/plugins/table/nodeviews/__mocks__/OverflowShadowsObserver.d.ts +9 -0
- package/dist/types-ts4.0/plugins/table/nodeviews/__mocks__/OverridableMock.d.ts +9 -0
- package/dist/types-ts4.0/plugins/table/nodeviews/table.d.ts +31 -0
- package/dist/types-ts4.0/plugins/table/nodeviews/tableCell.d.ts +19 -0
- package/dist/types-ts4.0/plugins/table/nodeviews/types.d.ts +23 -0
- package/dist/types-ts4.0/plugins/table/nodeviews/update-overflow-shadows.d.ts +8 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/plugin.d.ts +7 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/column-controls.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/column-resizing.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/compose-decorations.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/index.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/types.d.ts +6 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/default-table-selection.d.ts +5 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/keymap.d.ts +5 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/main.d.ts +8 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/plugin-factory.d.ts +1 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +15 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/commands.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/index.d.ts +6 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +6 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +65 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/plugin-key.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/plugin-state.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/types.d.ts +16 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/util.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-local-id.d.ts +22 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/commands.d.ts +25 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/index.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/plugin-factory.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/plugin-key.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/plugin.d.ts +6 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/reducer.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +8 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/column-state.d.ts +14 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/content-width.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +13 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/index.d.ts +12 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +22 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/resize-logic.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +29 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +17 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +22 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.d.ts +1 -0
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-selection-keymap.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/reducer.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/todo-stubs.d.ts +1 -0
- package/dist/types-ts4.0/plugins/table/toolbar.d.ts +36 -0
- package/dist/types-ts4.0/plugins/table/transforms/column-width.d.ts +18 -0
- package/dist/types-ts4.0/plugins/table/transforms/delete-columns.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/transforms/delete-rows.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/transforms/fix-tables.d.ts +10 -0
- package/dist/types-ts4.0/plugins/table/transforms/index.d.ts +7 -0
- package/dist/types-ts4.0/plugins/table/transforms/merge.d.ts +5 -0
- package/dist/types-ts4.0/plugins/table/transforms/metadata.d.ts +21 -0
- package/dist/types-ts4.0/plugins/table/transforms/replace-table.d.ts +5 -0
- package/dist/types-ts4.0/plugins/table/transforms/split.d.ts +9 -0
- package/dist/types-ts4.0/plugins/table/types.d.ts +328 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingContextualButton/index.d.ts +29 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingContextualButton/styles.d.ts +1 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +87 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingContextualMenu/index.d.ts +22 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingContextualMenu/styles.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +14 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.d.ts +10 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingDeleteButton/index.d.ts +54 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingDeleteButton/types.d.ts +1 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +12 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +3 -0
- package/dist/types-ts4.0/plugins/table/ui/FloatingInsertButton/index.d.ts +35 -0
- package/dist/types-ts4.0/plugins/table/ui/LayoutButton/index.d.ts +21 -0
- package/dist/types-ts4.0/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +19 -0
- package/dist/types-ts4.0/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +21 -0
- package/dist/types-ts4.0/plugins/table/ui/TableFloatingControls/RowControls/index.d.ts +17 -0
- package/dist/types-ts4.0/plugins/table/ui/TableFloatingControls/index.d.ts +40 -0
- package/dist/types-ts4.0/plugins/table/ui/common-styles.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/ui/consts.d.ts +39 -0
- package/dist/types-ts4.0/plugins/table/ui/messages.d.ts +38 -0
- package/dist/types-ts4.0/plugins/table/ui/ui-styles.d.ts +15 -0
- package/dist/types-ts4.0/plugins/table/utils/analytics.d.ts +18 -0
- package/dist/types-ts4.0/plugins/table/utils/collapse.d.ts +29 -0
- package/dist/types-ts4.0/plugins/table/utils/column-controls.d.ts +10 -0
- package/dist/types-ts4.0/plugins/table/utils/decoration.d.ts +16 -0
- package/dist/types-ts4.0/plugins/table/utils/dom.d.ts +20 -0
- package/dist/types-ts4.0/plugins/table/utils/get-allow-add-column-custom-step.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/utils/index.d.ts +11 -0
- package/dist/types-ts4.0/plugins/table/utils/nodes.d.ts +12 -0
- package/dist/types-ts4.0/plugins/table/utils/paste.d.ts +14 -0
- package/dist/types-ts4.0/plugins/table/utils/referentiality.d.ts +2 -0
- package/dist/types-ts4.0/plugins/table/utils/row-controls.d.ts +16 -0
- package/dist/types-ts4.0/plugins/table/utils/selection.d.ts +6 -0
- package/dist/types-ts4.0/plugins/table/utils/table.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table/utils/update-plugin-state-decorations.d.ts +4 -0
- package/dist/types-ts4.0/plugins/table-plugin.d.ts +2 -0
- package/dist/types-ts4.0/types.d.ts +3 -0
- package/examples/99-testing.tsx +227 -0
- package/package.json +16 -3
- package/report.api.md +61 -24
- package/src/plugins/table/__tests__/integration/__fixtures__/auto-size-documents.ts +439 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/basic-table.ts +120 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/empty-paragraph-underneath-table.ts +396 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/even-columns.ts +493 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/layout-documents.ts +607 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/merged-rows-and-cols-document.ts +343 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/nested-in-extension.ts +163 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/paragraph-and-table-adf.json +130 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/resize-documents.ts +1610 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/scale.ts +825 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/table-inside-layout.ts +145 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/table-with-min-width-columns-document.ts +175 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/table-with-multiline-date.adf.json +168 -0
- package/src/plugins/table/__tests__/integration/__fixtures__/table-with-text-and-empty-row.ts +216 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/auto-size.ts.snap +609 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/change-date-inside-table.ts.snap +173 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/copy-button.ts.snap +421 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/delete-columns.ts.snap +818 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/delete-last-column-in-full-width.ts.snap +119 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/delete-last-column-with-empty-action.ts.snap +119 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/delete-last-row-with-empty-action.ts.snap +227 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/delete-rows.ts.snap +959 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/delete-table-when-selected.ts.snap +101 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/deleting-empty-paragraph-under-table.ts.snap +502 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/even-columns.ts.snap +645 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/insert-cell-header-with-strong-mark.ts.snap +172 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/insert-row-inside-layout.ts.snap +238 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/layout.ts.snap +1645 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/resize.ts.snap +2674 -0
- package/src/plugins/table/__tests__/integration/__snapshots__/scale.ts.snap +1083 -0
- package/src/plugins/table/__tests__/integration/arrow-down-into-table.ts +38 -0
- package/src/plugins/table/__tests__/integration/auto-size.ts +87 -0
- package/src/plugins/table/__tests__/integration/block-node-selection.ts +162 -163
- package/src/plugins/table/__tests__/integration/cell-selection.ts +101 -0
- package/src/plugins/table/__tests__/integration/change-date-inside-table.ts +47 -0
- package/src/plugins/table/__tests__/integration/copy-button.ts +179 -0
- package/src/plugins/table/__tests__/integration/delete-columns.ts +95 -0
- package/src/plugins/table/__tests__/integration/delete-last-column-in-full-width.ts +70 -0
- package/src/plugins/table/__tests__/integration/delete-last-column-with-empty-action.ts +58 -0
- package/src/plugins/table/__tests__/integration/delete-last-row-with-empty-action.ts +97 -0
- package/src/plugins/table/__tests__/integration/delete-rows.ts +122 -0
- package/src/plugins/table/__tests__/integration/delete-table-when-selected.ts +110 -0
- package/src/plugins/table/__tests__/integration/deleting-empty-paragraph-under-table.ts +86 -0
- package/src/plugins/table/__tests__/integration/even-columns.ts +72 -0
- package/src/plugins/table/__tests__/integration/insert-cell-header-with-strong-mark.ts +40 -0
- package/src/plugins/table/__tests__/integration/insert-long-smart-link.ts +52 -0
- package/src/plugins/table/__tests__/integration/insert-row-inside-layout.ts +47 -0
- package/src/plugins/table/__tests__/integration/layout.ts +224 -0
- package/src/plugins/table/__tests__/integration/resize-handler.ts +101 -0
- package/src/plugins/table/__tests__/integration/resize.ts +342 -0
- package/src/plugins/table/__tests__/integration/scale.ts +67 -0
- package/src/plugins/table/__tests__/integration/table-controls-selection.ts +70 -0
- package/src/plugins/table/__tests__/unit/commands/insert.ts +0 -1
- package/src/plugins/table/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +2 -0
- package/src/plugins/table/index.tsx +322 -295
- package/src/plugins/table/ui/FloatingContextualButton/index.tsx +2 -2
- package/types/package.json +8 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
editable,
|
|
5
|
+
getDocFromElement,
|
|
6
|
+
fullpage,
|
|
7
|
+
clipboardInput,
|
|
8
|
+
copyAsPlaintextButton,
|
|
9
|
+
copyAsHTMLButton,
|
|
10
|
+
} from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
11
|
+
import {
|
|
12
|
+
goToEditorTestingWDExample,
|
|
13
|
+
mountEditor,
|
|
14
|
+
} from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
15
|
+
import {
|
|
16
|
+
tableSelectors,
|
|
17
|
+
clickFirstCell,
|
|
18
|
+
waitForNoTable,
|
|
19
|
+
} from '@atlaskit/editor-test-helpers/page-objects/table';
|
|
20
|
+
|
|
21
|
+
import basicTableAdf from './__fixtures__/basic-table';
|
|
22
|
+
|
|
23
|
+
BrowserTestCase(
|
|
24
|
+
'replaces table with text when user types with a full-table cell selection',
|
|
25
|
+
{},
|
|
26
|
+
async (client: any, testName: string) => {
|
|
27
|
+
const page = await goToEditorTestingWDExample(
|
|
28
|
+
client,
|
|
29
|
+
'editor-plugin-table',
|
|
30
|
+
);
|
|
31
|
+
await mountEditor(page, {
|
|
32
|
+
appearance: fullpage.appearance,
|
|
33
|
+
allowTables: {
|
|
34
|
+
advanced: true,
|
|
35
|
+
},
|
|
36
|
+
defaultValue: basicTableAdf,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
await clickFirstCell(page);
|
|
40
|
+
await page.click(tableSelectors.cornerButton);
|
|
41
|
+
await page.keys('A');
|
|
42
|
+
|
|
43
|
+
await waitForNoTable(page);
|
|
44
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
45
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
46
|
+
},
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
BrowserTestCase(
|
|
50
|
+
'replaces table with content when user pastes plain text with a full-table cell selection',
|
|
51
|
+
{ skip: [] },
|
|
52
|
+
async (client: any, testName: string) => {
|
|
53
|
+
const page = await goToEditorTestingWDExample(
|
|
54
|
+
client,
|
|
55
|
+
'editor-plugin-table',
|
|
56
|
+
);
|
|
57
|
+
await page.waitFor(clipboardInput);
|
|
58
|
+
await page.type(clipboardInput, 'Some text to copy');
|
|
59
|
+
await page.click(copyAsPlaintextButton);
|
|
60
|
+
|
|
61
|
+
await mountEditor(page, {
|
|
62
|
+
appearance: fullpage.appearance,
|
|
63
|
+
allowTables: {
|
|
64
|
+
advanced: true,
|
|
65
|
+
},
|
|
66
|
+
defaultValue: basicTableAdf,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
await clickFirstCell(page);
|
|
70
|
+
await page.click(tableSelectors.cornerButton);
|
|
71
|
+
await page.paste();
|
|
72
|
+
|
|
73
|
+
await waitForNoTable(page);
|
|
74
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
75
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
76
|
+
},
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
BrowserTestCase(
|
|
80
|
+
'replaces table with content when user pastes rich text with a full-table cell selection',
|
|
81
|
+
{ skip: [] },
|
|
82
|
+
async (client: any, testName: string) => {
|
|
83
|
+
const page = await goToEditorTestingWDExample(
|
|
84
|
+
client,
|
|
85
|
+
'editor-plugin-table',
|
|
86
|
+
);
|
|
87
|
+
await page.waitFor(clipboardInput);
|
|
88
|
+
await page.type(
|
|
89
|
+
clipboardInput,
|
|
90
|
+
'<p>this is a link <a href="http://www.google.com">www.google.com</a></p><p>more elements with some <strong>format</strong></p><p>some addition<em> formatting</em></p>',
|
|
91
|
+
);
|
|
92
|
+
await page.click(copyAsHTMLButton);
|
|
93
|
+
|
|
94
|
+
await mountEditor(page, {
|
|
95
|
+
appearance: fullpage.appearance,
|
|
96
|
+
allowTables: {
|
|
97
|
+
advanced: true,
|
|
98
|
+
},
|
|
99
|
+
defaultValue: basicTableAdf,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
await clickFirstCell(page);
|
|
103
|
+
await page.click(tableSelectors.cornerButton);
|
|
104
|
+
await page.paste();
|
|
105
|
+
|
|
106
|
+
await waitForNoTable(page);
|
|
107
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
108
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
109
|
+
},
|
|
110
|
+
);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
2
|
+
import {
|
|
3
|
+
fullpage,
|
|
4
|
+
setProseMirrorTextSelection,
|
|
5
|
+
expectToMatchSelection,
|
|
6
|
+
editable,
|
|
7
|
+
getDocFromElement,
|
|
8
|
+
} from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
9
|
+
import {
|
|
10
|
+
goToEditorTestingWDExample,
|
|
11
|
+
mountEditor,
|
|
12
|
+
} from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
13
|
+
import {
|
|
14
|
+
emptyParagraphUnderneathTable,
|
|
15
|
+
emptyParagraphUnderneathTableAtEnd,
|
|
16
|
+
filledParagraphUnderneathTable,
|
|
17
|
+
} from './__fixtures__/empty-paragraph-underneath-table';
|
|
18
|
+
|
|
19
|
+
BrowserTestCase(
|
|
20
|
+
`backspace for an empty paragraph not at the end of the document should delete that paragraph and
|
|
21
|
+
place cursor inside last cell of table`,
|
|
22
|
+
{},
|
|
23
|
+
async (client: any, testName: string) => {
|
|
24
|
+
const page = await goToEditorTestingWDExample(
|
|
25
|
+
client,
|
|
26
|
+
'editor-plugin-table',
|
|
27
|
+
);
|
|
28
|
+
await mountEditor(page, {
|
|
29
|
+
appearance: fullpage.appearance,
|
|
30
|
+
allowTables: {},
|
|
31
|
+
defaultValue: emptyParagraphUnderneathTable,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
await setProseMirrorTextSelection(page, { anchor: 45 });
|
|
35
|
+
await page.keys('Backspace');
|
|
36
|
+
await expectToMatchSelection(page, { type: 'text', to: 40, from: 40 });
|
|
37
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
38
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
39
|
+
},
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
BrowserTestCase(
|
|
43
|
+
`backspace for an empty paragraph at the end of the document should only
|
|
44
|
+
place cursor inside last cell of table`,
|
|
45
|
+
{},
|
|
46
|
+
async (client: any, testName: string) => {
|
|
47
|
+
const page = await goToEditorTestingWDExample(
|
|
48
|
+
client,
|
|
49
|
+
'editor-plugin-table',
|
|
50
|
+
);
|
|
51
|
+
await mountEditor(page, {
|
|
52
|
+
appearance: fullpage.appearance,
|
|
53
|
+
allowTables: {},
|
|
54
|
+
defaultValue: emptyParagraphUnderneathTableAtEnd,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
await setProseMirrorTextSelection(page, { anchor: 45 });
|
|
58
|
+
await page.keys('Backspace');
|
|
59
|
+
await expectToMatchSelection(page, { type: 'text', to: 40, from: 40 });
|
|
60
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
61
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
62
|
+
},
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
BrowserTestCase(
|
|
66
|
+
`backspace for an filled paragraph not at the end of the document should
|
|
67
|
+
place cursor inside last cell of table`,
|
|
68
|
+
{},
|
|
69
|
+
async (client: any, testName: string) => {
|
|
70
|
+
const page = await goToEditorTestingWDExample(
|
|
71
|
+
client,
|
|
72
|
+
'editor-plugin-table',
|
|
73
|
+
);
|
|
74
|
+
await mountEditor(page, {
|
|
75
|
+
appearance: fullpage.appearance,
|
|
76
|
+
allowTables: {},
|
|
77
|
+
defaultValue: filledParagraphUnderneathTable,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
await setProseMirrorTextSelection(page, { anchor: 45 });
|
|
81
|
+
await page.keys('Backspace');
|
|
82
|
+
await expectToMatchSelection(page, { type: 'text', to: 40, from: 40 });
|
|
83
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
84
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
85
|
+
},
|
|
86
|
+
);
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
2
|
+
import {
|
|
3
|
+
editable,
|
|
4
|
+
getDocFromElement,
|
|
5
|
+
fullpage,
|
|
6
|
+
doubleClickResizeHandle,
|
|
7
|
+
} from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
8
|
+
import {
|
|
9
|
+
clickFirstCell,
|
|
10
|
+
selectTable,
|
|
11
|
+
} from '@atlaskit/editor-test-helpers/page-objects/table';
|
|
12
|
+
import {
|
|
13
|
+
tableWithUnevenColumns,
|
|
14
|
+
tableWithUnevenColumnsInOverflow,
|
|
15
|
+
} from './__fixtures__/even-columns';
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
goToEditorTestingWDExample,
|
|
19
|
+
mountEditor,
|
|
20
|
+
} from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
21
|
+
|
|
22
|
+
// moveTo in doubleClickResizeHandle does not work for safari
|
|
23
|
+
BrowserTestCase(
|
|
24
|
+
'Should even columns on double click on resize handle when table is selected',
|
|
25
|
+
{ skip: ['safari'] },
|
|
26
|
+
async (client: any, testName: string) => {
|
|
27
|
+
const page = await goToEditorTestingWDExample(
|
|
28
|
+
client,
|
|
29
|
+
'editor-plugin-table',
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
await mountEditor(page, {
|
|
33
|
+
appearance: fullpage.appearance,
|
|
34
|
+
defaultValue: JSON.stringify(tableWithUnevenColumns),
|
|
35
|
+
allowTables: {
|
|
36
|
+
advanced: true,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
await clickFirstCell(page);
|
|
40
|
+
await selectTable(page);
|
|
41
|
+
await doubleClickResizeHandle(page, 2, 2);
|
|
42
|
+
|
|
43
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
44
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
45
|
+
},
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
// moveTo in doubleClickResizeHandle does not work for safari
|
|
49
|
+
BrowserTestCase(
|
|
50
|
+
'Should even columns and remain overflown on double click on resize handle when table is selected',
|
|
51
|
+
{ skip: ['safari'] },
|
|
52
|
+
async (client: any, testName: string) => {
|
|
53
|
+
const page = await goToEditorTestingWDExample(
|
|
54
|
+
client,
|
|
55
|
+
'editor-plugin-table',
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
await mountEditor(page, {
|
|
59
|
+
appearance: fullpage.appearance,
|
|
60
|
+
defaultValue: JSON.stringify(tableWithUnevenColumnsInOverflow),
|
|
61
|
+
allowTables: {
|
|
62
|
+
advanced: true,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
await clickFirstCell(page);
|
|
66
|
+
await selectTable(page);
|
|
67
|
+
await doubleClickResizeHandle(page, 2, 2);
|
|
68
|
+
|
|
69
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
70
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
71
|
+
},
|
|
72
|
+
);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
editable,
|
|
5
|
+
getDocFromElement,
|
|
6
|
+
fullpage,
|
|
7
|
+
quickInsert,
|
|
8
|
+
} from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
9
|
+
import {
|
|
10
|
+
mountEditor,
|
|
11
|
+
goToEditorTestingWDExample,
|
|
12
|
+
} from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
13
|
+
|
|
14
|
+
BrowserTestCase(
|
|
15
|
+
'inside-table.ts: Insert panel into table, add text, change panel type',
|
|
16
|
+
{},
|
|
17
|
+
async (client: any, testName: string) => {
|
|
18
|
+
const page = await goToEditorTestingWDExample(
|
|
19
|
+
client,
|
|
20
|
+
'editor-plugin-table',
|
|
21
|
+
);
|
|
22
|
+
await mountEditor(page, {
|
|
23
|
+
appearance: fullpage.appearance,
|
|
24
|
+
allowPanel: true,
|
|
25
|
+
allowTables: {
|
|
26
|
+
advanced: true,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
await page.click(editable);
|
|
31
|
+
|
|
32
|
+
// Insert table
|
|
33
|
+
await quickInsert(page, 'Table');
|
|
34
|
+
|
|
35
|
+
await page.type(editable, 'this has a strong mark');
|
|
36
|
+
|
|
37
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
38
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
39
|
+
},
|
|
40
|
+
);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
2
|
+
import Page from '@atlaskit/webdriver-runner/wd-wrapper';
|
|
3
|
+
import { waitForInlineCard } from '@atlaskit/media-integration-test-helpers';
|
|
4
|
+
import { inlineCardLongNameSlowResolveUrl } from '@atlaskit/editor-test-helpers/card-provider';
|
|
5
|
+
import {
|
|
6
|
+
copyToClipboard,
|
|
7
|
+
gotoEditor,
|
|
8
|
+
} from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
9
|
+
import {
|
|
10
|
+
clickFirstCell,
|
|
11
|
+
insertTable,
|
|
12
|
+
tableSelectors,
|
|
13
|
+
} from '@atlaskit/editor-test-helpers/page-objects/table';
|
|
14
|
+
|
|
15
|
+
BrowserTestCase(
|
|
16
|
+
'table row controls should be same height as table body after a long title smart link finishes async rendering',
|
|
17
|
+
{ skip: ['safari'] },
|
|
18
|
+
async (client: any) => {
|
|
19
|
+
let page = new Page(client);
|
|
20
|
+
await copyToClipboard(page, inlineCardLongNameSlowResolveUrl);
|
|
21
|
+
await gotoEditor(page);
|
|
22
|
+
await insertTable(page);
|
|
23
|
+
await clickFirstCell(page);
|
|
24
|
+
await page.paste();
|
|
25
|
+
await waitForInlineCard(page);
|
|
26
|
+
|
|
27
|
+
const { tableBodyHeight, tableRowControlsHeight } = await page.evaluate<{
|
|
28
|
+
tableBodyHeight: number;
|
|
29
|
+
tableRowControlsHeight: number;
|
|
30
|
+
}>(
|
|
31
|
+
(tableRowControlsSelector, tableBodySelector) => {
|
|
32
|
+
const tableRowControls = document.querySelector(
|
|
33
|
+
tableRowControlsSelector,
|
|
34
|
+
) as HTMLElement;
|
|
35
|
+
const tableBody = document.querySelector(tableBodySelector);
|
|
36
|
+
if (!tableBody || !tableRowControls) {
|
|
37
|
+
throw new Error(
|
|
38
|
+
'Missing tableBody or tableRowControls, exiting test',
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
tableBodyHeight: Math.round(tableBody.offsetHeight),
|
|
43
|
+
tableRowControlsHeight: Math.round(tableRowControls.offsetHeight),
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
tableSelectors.rowControlsForTableBody,
|
|
47
|
+
tableSelectors.tableBody,
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
expect(tableBodyHeight).toBe(tableRowControlsHeight);
|
|
51
|
+
},
|
|
52
|
+
);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
2
|
+
import {
|
|
3
|
+
editable,
|
|
4
|
+
animationFrame,
|
|
5
|
+
getDocFromElement,
|
|
6
|
+
fullpage,
|
|
7
|
+
} from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
8
|
+
import { insertRow } from '@atlaskit/editor-test-helpers/page-objects/table';
|
|
9
|
+
import { table as tableInsideLayout } from './__fixtures__/table-inside-layout';
|
|
10
|
+
import {
|
|
11
|
+
goToEditorTestingWDExample,
|
|
12
|
+
mountEditor,
|
|
13
|
+
} from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
14
|
+
|
|
15
|
+
import { clickFirstCell } from '@atlaskit/editor-test-helpers/page-objects/table';
|
|
16
|
+
|
|
17
|
+
BrowserTestCase(
|
|
18
|
+
'Should scale remaining columns when adding a new column preventing from going to overflow',
|
|
19
|
+
{ skip: [] },
|
|
20
|
+
async (client: any, testName: string) => {
|
|
21
|
+
const page = await goToEditorTestingWDExample(
|
|
22
|
+
client,
|
|
23
|
+
'editor-plugin-table',
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
await mountEditor(page, {
|
|
27
|
+
appearance: fullpage.appearance,
|
|
28
|
+
defaultValue: JSON.stringify(tableInsideLayout),
|
|
29
|
+
allowTables: {
|
|
30
|
+
advanced: true,
|
|
31
|
+
},
|
|
32
|
+
allowLayouts: {
|
|
33
|
+
allowBreakout: true,
|
|
34
|
+
},
|
|
35
|
+
allowBreakout: true,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
await clickFirstCell(page);
|
|
39
|
+
await animationFrame(page);
|
|
40
|
+
await animationFrame(page);
|
|
41
|
+
await insertRow(page, 1);
|
|
42
|
+
await page.type(editable, 'should be inside of the table');
|
|
43
|
+
|
|
44
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
45
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
46
|
+
},
|
|
47
|
+
);
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
editable,
|
|
5
|
+
getDocFromElement,
|
|
6
|
+
fullpage,
|
|
7
|
+
changeSelectedNodeLayout,
|
|
8
|
+
animationFrame,
|
|
9
|
+
toggleBreakout,
|
|
10
|
+
} from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
11
|
+
|
|
12
|
+
import { clickFirstCell } from '@atlaskit/editor-test-helpers/page-objects/table';
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
defaultTableInOverflow,
|
|
16
|
+
defaultTableResizedTable,
|
|
17
|
+
nestedTables,
|
|
18
|
+
} from './__fixtures__/layout-documents';
|
|
19
|
+
|
|
20
|
+
import {
|
|
21
|
+
goToEditorTestingWDExample,
|
|
22
|
+
mountEditor,
|
|
23
|
+
} from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
24
|
+
|
|
25
|
+
import messages from '@atlaskit/editor-core/src/messages';
|
|
26
|
+
|
|
27
|
+
BrowserTestCase(
|
|
28
|
+
'Avoid overflow when table scale to wide',
|
|
29
|
+
{ skip: ['safari', 'firefox'] },
|
|
30
|
+
async (client: any, testName: string) => {
|
|
31
|
+
const page = await goToEditorTestingWDExample(
|
|
32
|
+
client,
|
|
33
|
+
'editor-plugin-table',
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
await mountEditor(page, {
|
|
37
|
+
appearance: fullpage.appearance,
|
|
38
|
+
defaultValue: JSON.stringify(defaultTableInOverflow),
|
|
39
|
+
allowTables: {
|
|
40
|
+
advanced: true,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
await clickFirstCell(page);
|
|
45
|
+
await toggleBreakout(page, 1);
|
|
46
|
+
|
|
47
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
48
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
49
|
+
},
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
BrowserTestCase(
|
|
53
|
+
'Avoid overflow when table scale to full width',
|
|
54
|
+
{ skip: ['safari', 'firefox'] },
|
|
55
|
+
async (client: any, testName: string) => {
|
|
56
|
+
const page = await goToEditorTestingWDExample(
|
|
57
|
+
client,
|
|
58
|
+
'editor-plugin-table',
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
await mountEditor(page, {
|
|
62
|
+
appearance: fullpage.appearance,
|
|
63
|
+
defaultValue: JSON.stringify(defaultTableInOverflow),
|
|
64
|
+
allowTables: {
|
|
65
|
+
advanced: true,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
await clickFirstCell(page);
|
|
70
|
+
await toggleBreakout(page, 2);
|
|
71
|
+
|
|
72
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
73
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
74
|
+
},
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
BrowserTestCase(
|
|
78
|
+
'Maintains the wide layout size without overflow',
|
|
79
|
+
{ skip: ['firefox', 'safari'] },
|
|
80
|
+
async (client: any, testName: string) => {
|
|
81
|
+
const page = await goToEditorTestingWDExample(
|
|
82
|
+
client,
|
|
83
|
+
'editor-plugin-table',
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
await mountEditor(page, {
|
|
87
|
+
appearance: fullpage.appearance,
|
|
88
|
+
defaultValue: JSON.stringify(defaultTableResizedTable),
|
|
89
|
+
allowTables: {
|
|
90
|
+
advanced: true,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
await clickFirstCell(page);
|
|
95
|
+
await toggleBreakout(page, 1);
|
|
96
|
+
|
|
97
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
98
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
99
|
+
},
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
BrowserTestCase(
|
|
103
|
+
'Maintains the full-width layout size without overflow',
|
|
104
|
+
{ skip: ['firefox', 'safari'] },
|
|
105
|
+
async (client: any, testName: string) => {
|
|
106
|
+
const page = await goToEditorTestingWDExample(
|
|
107
|
+
client,
|
|
108
|
+
'editor-plugin-table',
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
await mountEditor(page, {
|
|
112
|
+
appearance: fullpage.appearance,
|
|
113
|
+
defaultValue: JSON.stringify(defaultTableResizedTable),
|
|
114
|
+
allowTables: {
|
|
115
|
+
advanced: true,
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
await clickFirstCell(page);
|
|
120
|
+
await toggleBreakout(page, 2);
|
|
121
|
+
|
|
122
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
123
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
124
|
+
},
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
BrowserTestCase(
|
|
128
|
+
'Maintains the default layout size without overflow when toggling through layouts',
|
|
129
|
+
{ skip: ['safari', 'firefox'] },
|
|
130
|
+
async (client: any, testName: string) => {
|
|
131
|
+
const page = await goToEditorTestingWDExample(
|
|
132
|
+
client,
|
|
133
|
+
'editor-plugin-table',
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
await mountEditor(page, {
|
|
137
|
+
appearance: fullpage.appearance,
|
|
138
|
+
defaultValue: JSON.stringify(defaultTableResizedTable),
|
|
139
|
+
allowTables: {
|
|
140
|
+
advanced: true,
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
await clickFirstCell(page);
|
|
145
|
+
await toggleBreakout(page, 3);
|
|
146
|
+
|
|
147
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
148
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
149
|
+
},
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
BrowserTestCase(
|
|
153
|
+
'Scales down column sizes when bodied extension parent layout changes',
|
|
154
|
+
{ skip: ['firefox', 'safari'] },
|
|
155
|
+
async (client: any, testName: string) => {
|
|
156
|
+
const page = await goToEditorTestingWDExample(
|
|
157
|
+
client,
|
|
158
|
+
'editor-plugin-table',
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
await mountEditor(page, {
|
|
162
|
+
appearance: fullpage.appearance,
|
|
163
|
+
defaultValue: JSON.stringify(nestedTables),
|
|
164
|
+
allowTables: {
|
|
165
|
+
advanced: true,
|
|
166
|
+
},
|
|
167
|
+
allowExtension: {
|
|
168
|
+
allowBreakout: true,
|
|
169
|
+
},
|
|
170
|
+
allowLayouts: {
|
|
171
|
+
allowBreakout: true,
|
|
172
|
+
},
|
|
173
|
+
allowBreakout: true,
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
await page.waitForSelector('.extension-container p');
|
|
177
|
+
await page.click('.extension-container p');
|
|
178
|
+
await changeSelectedNodeLayout(
|
|
179
|
+
page,
|
|
180
|
+
messages.layoutFixedWidth.defaultMessage,
|
|
181
|
+
);
|
|
182
|
+
await animationFrame(page);
|
|
183
|
+
|
|
184
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
185
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
186
|
+
},
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
BrowserTestCase(
|
|
190
|
+
'Scales down column sizes when parent layout changes breakout',
|
|
191
|
+
{ skip: ['firefox', 'safari'] },
|
|
192
|
+
async (client: any, testName: string) => {
|
|
193
|
+
const page = await goToEditorTestingWDExample(
|
|
194
|
+
client,
|
|
195
|
+
'editor-plugin-table',
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
await mountEditor(page, {
|
|
199
|
+
appearance: fullpage.appearance,
|
|
200
|
+
defaultValue: JSON.stringify(nestedTables),
|
|
201
|
+
allowTables: {
|
|
202
|
+
advanced: true,
|
|
203
|
+
},
|
|
204
|
+
allowExtension: {
|
|
205
|
+
allowBreakout: true,
|
|
206
|
+
},
|
|
207
|
+
allowLayouts: {
|
|
208
|
+
allowBreakout: true,
|
|
209
|
+
},
|
|
210
|
+
allowBreakout: true,
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
await page.waitForSelector('div[data-layout-section]');
|
|
214
|
+
// Clicking at the paragraph inside of the left layout column
|
|
215
|
+
await page.click(
|
|
216
|
+
'div[data-layout-section] [data-layout-column="true"]:nth-child(2) [data-layout-content="true"] > p',
|
|
217
|
+
);
|
|
218
|
+
await toggleBreakout(page, 2);
|
|
219
|
+
await animationFrame(page);
|
|
220
|
+
|
|
221
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
222
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
223
|
+
},
|
|
224
|
+
);
|