@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,38 @@
|
|
|
1
|
+
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
2
|
+
import {
|
|
3
|
+
fullpage,
|
|
4
|
+
setProseMirrorTextSelection,
|
|
5
|
+
expectToMatchSelection,
|
|
6
|
+
} from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
7
|
+
import {
|
|
8
|
+
goToEditorTestingWDExample,
|
|
9
|
+
mountEditor,
|
|
10
|
+
} from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
11
|
+
import tableAdf from './__fixtures__/paragraph-and-table-adf.json';
|
|
12
|
+
|
|
13
|
+
// This keyboard navigation is actually browser functionality
|
|
14
|
+
// But there was a div on our end that caused a bug where the
|
|
15
|
+
// cursor would go behind the table when pressing arrow down
|
|
16
|
+
// https://product-fabric.atlassian.net/browse/ED-14046
|
|
17
|
+
//
|
|
18
|
+
// Skipping in firefox as there is a known bug
|
|
19
|
+
// Needs to be fixed in https://product-fabric.atlassian.net/servicedesk/customer/portal/99/DTR-155?created=true
|
|
20
|
+
BrowserTestCase(
|
|
21
|
+
'arrow-down-into-table.ts: pressing arrow down above table should move cursor into first row',
|
|
22
|
+
{ skip: ['firefox'] },
|
|
23
|
+
async (client: any) => {
|
|
24
|
+
const page = await goToEditorTestingWDExample(
|
|
25
|
+
client,
|
|
26
|
+
'editor-plugin-table',
|
|
27
|
+
);
|
|
28
|
+
await mountEditor(page, {
|
|
29
|
+
appearance: fullpage.appearance,
|
|
30
|
+
allowTables: {},
|
|
31
|
+
defaultValue: tableAdf,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
await setProseMirrorTextSelection(page, { anchor: 5 });
|
|
35
|
+
await page.keys('ArrowDown');
|
|
36
|
+
await expectToMatchSelection(page, { type: 'text', to: 10, from: 10 });
|
|
37
|
+
},
|
|
38
|
+
);
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
2
|
+
import sleep from '@atlaskit/editor-test-helpers/sleep';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
editable,
|
|
6
|
+
getDocFromElement,
|
|
7
|
+
fullpage,
|
|
8
|
+
} from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
autoSizeToDefaultLayout,
|
|
12
|
+
autoSizeToWideLayout,
|
|
13
|
+
autoSizeToFullWidthLayout,
|
|
14
|
+
} from './__fixtures__/auto-size-documents';
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
goToEditorTestingWDExample,
|
|
18
|
+
mountEditor,
|
|
19
|
+
} from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
20
|
+
|
|
21
|
+
async function loadAndRetrieveDocument(
|
|
22
|
+
page: any,
|
|
23
|
+
document: object,
|
|
24
|
+
expectedLayout = 'default',
|
|
25
|
+
) {
|
|
26
|
+
await mountEditor(page, {
|
|
27
|
+
appearance: fullpage.appearance,
|
|
28
|
+
defaultValue: JSON.stringify(document),
|
|
29
|
+
allowPanel: true,
|
|
30
|
+
allowTables: {
|
|
31
|
+
advanced: true,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
await page.waitForSelector(`table[data-layout="${expectedLayout}"]`);
|
|
36
|
+
await sleep(500);
|
|
37
|
+
|
|
38
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
39
|
+
return doc;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
BrowserTestCase(
|
|
43
|
+
'Doesnt scale past default',
|
|
44
|
+
{ skip: ['*'] },
|
|
45
|
+
async (client: any, testName: string) => {
|
|
46
|
+
const page = await goToEditorTestingWDExample(
|
|
47
|
+
client,
|
|
48
|
+
'editor-plugin-table',
|
|
49
|
+
);
|
|
50
|
+
const doc = await loadAndRetrieveDocument(page, autoSizeToDefaultLayout);
|
|
51
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
52
|
+
},
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
BrowserTestCase(
|
|
56
|
+
'Scales to wide',
|
|
57
|
+
{ skip: ['*'] },
|
|
58
|
+
async (client: any, testName: string) => {
|
|
59
|
+
const page = await goToEditorTestingWDExample(
|
|
60
|
+
client,
|
|
61
|
+
'editor-plugin-table',
|
|
62
|
+
);
|
|
63
|
+
const doc = await loadAndRetrieveDocument(
|
|
64
|
+
page,
|
|
65
|
+
autoSizeToWideLayout,
|
|
66
|
+
'wide',
|
|
67
|
+
);
|
|
68
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
69
|
+
},
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
BrowserTestCase(
|
|
73
|
+
'Scales to full-width',
|
|
74
|
+
{ skip: ['safari', 'firefox'] },
|
|
75
|
+
async (client: any, testName: string) => {
|
|
76
|
+
const page = await goToEditorTestingWDExample(
|
|
77
|
+
client,
|
|
78
|
+
'editor-plugin-table',
|
|
79
|
+
);
|
|
80
|
+
const doc = await loadAndRetrieveDocument(
|
|
81
|
+
page,
|
|
82
|
+
autoSizeToFullWidthLayout,
|
|
83
|
+
'full-width',
|
|
84
|
+
);
|
|
85
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
86
|
+
},
|
|
87
|
+
);
|
|
@@ -1,164 +1,163 @@
|
|
|
1
|
-
|
|
2
|
-
// import { runBlockNodeSelectionTestSuite } from '../../../../__tests__/integration/selection/_blockNodeSelectionTestSuite';
|
|
1
|
+
import { runBlockNodeSelectionTestSuite } from '@atlaskit/editor-test-helpers/integration/selection';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
3
|
+
runBlockNodeSelectionTestSuite({
|
|
4
|
+
nodeName: 'table',
|
|
5
|
+
editorOptions: {
|
|
6
|
+
allowTables: {
|
|
7
|
+
advanced: true,
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
selector: 'table',
|
|
11
|
+
adfNode: {
|
|
12
|
+
type: 'table',
|
|
13
|
+
attrs: {
|
|
14
|
+
isNumberColumnEnabled: false,
|
|
15
|
+
layout: 'default',
|
|
16
|
+
localId: '15804638-b946-4591-b64c-beffe5122733',
|
|
17
|
+
},
|
|
18
|
+
content: [
|
|
19
|
+
{
|
|
20
|
+
type: 'tableRow',
|
|
21
|
+
content: [
|
|
22
|
+
{
|
|
23
|
+
type: 'tableHeader',
|
|
24
|
+
attrs: {},
|
|
25
|
+
content: [
|
|
26
|
+
{
|
|
27
|
+
type: 'paragraph',
|
|
28
|
+
content: [],
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: 'tableHeader',
|
|
34
|
+
attrs: {},
|
|
35
|
+
content: [
|
|
36
|
+
{
|
|
37
|
+
type: 'paragraph',
|
|
38
|
+
content: [],
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type: 'tableHeader',
|
|
44
|
+
attrs: {},
|
|
45
|
+
content: [
|
|
46
|
+
{
|
|
47
|
+
type: 'paragraph',
|
|
48
|
+
content: [],
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type: 'tableRow',
|
|
56
|
+
content: [
|
|
57
|
+
{
|
|
58
|
+
type: 'tableCell',
|
|
59
|
+
attrs: {},
|
|
60
|
+
content: [
|
|
61
|
+
{
|
|
62
|
+
type: 'paragraph',
|
|
63
|
+
content: [],
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: 'tableCell',
|
|
69
|
+
attrs: {},
|
|
70
|
+
content: [
|
|
71
|
+
{
|
|
72
|
+
type: 'paragraph',
|
|
73
|
+
content: [],
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: 'tableCell',
|
|
79
|
+
attrs: {},
|
|
80
|
+
content: [
|
|
81
|
+
{
|
|
82
|
+
type: 'paragraph',
|
|
83
|
+
content: [],
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: 'tableRow',
|
|
91
|
+
content: [
|
|
92
|
+
{
|
|
93
|
+
type: 'tableCell',
|
|
94
|
+
attrs: {},
|
|
95
|
+
content: [
|
|
96
|
+
{
|
|
97
|
+
type: 'paragraph',
|
|
98
|
+
content: [],
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
type: 'tableCell',
|
|
104
|
+
attrs: {},
|
|
105
|
+
content: [
|
|
106
|
+
{
|
|
107
|
+
type: 'paragraph',
|
|
108
|
+
content: [],
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: 'tableCell',
|
|
114
|
+
attrs: {},
|
|
115
|
+
content: [
|
|
116
|
+
{
|
|
117
|
+
type: 'paragraph',
|
|
118
|
+
content: [],
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
skipTests: {
|
|
127
|
+
'Extend selection right two characters to select [block-node] from line above with shift + arrow right': [
|
|
128
|
+
'chrome',
|
|
129
|
+
'safari',
|
|
130
|
+
'firefox',
|
|
131
|
+
],
|
|
132
|
+
'Extend selection left two characters to select [block-node] from line below with shift + arrow left': [
|
|
133
|
+
'chrome',
|
|
134
|
+
'safari',
|
|
135
|
+
'firefox',
|
|
136
|
+
],
|
|
137
|
+
'Extend a selection from end of the document to the start when [block-node] is the first node': [
|
|
138
|
+
'chrome',
|
|
139
|
+
'safari',
|
|
140
|
+
'firefox',
|
|
141
|
+
],
|
|
142
|
+
'Click and drag from the end to start of the document to select [block-node] when [block-node] is the first node': [
|
|
143
|
+
'chrome',
|
|
144
|
+
'safari',
|
|
145
|
+
'firefox',
|
|
146
|
+
],
|
|
147
|
+
'Extend a selection to the end of the document from start when [block-node] is the last node': [
|
|
148
|
+
'chrome',
|
|
149
|
+
'safari',
|
|
150
|
+
'firefox',
|
|
151
|
+
],
|
|
152
|
+
'Click and drag from start of the document to select [block-node] when [block-node] is the last node': [
|
|
153
|
+
'chrome',
|
|
154
|
+
'safari',
|
|
155
|
+
'firefox',
|
|
156
|
+
],
|
|
157
|
+
"Extend selection down by one line multiple times to select [block-node]'s in sequence with shift + arrow down": [
|
|
158
|
+
'chrome',
|
|
159
|
+
'safari',
|
|
160
|
+
'firefox',
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
2
|
+
import { fullpage } from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
3
|
+
import {
|
|
4
|
+
goToEditorTestingWDExample,
|
|
5
|
+
mountEditor,
|
|
6
|
+
} from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
7
|
+
|
|
8
|
+
import tableWithTextAndEmptyRow from './__fixtures__/table-with-text-and-empty-row';
|
|
9
|
+
import {
|
|
10
|
+
multiCellTableSelectionTopLeftToBottomRight,
|
|
11
|
+
multiCellTableSelectionBottomRightToFirstCell,
|
|
12
|
+
multiCellTableSelectionBottomRightToMiddleTopCell,
|
|
13
|
+
} from '@atlaskit/editor-test-helpers/page-objects/table';
|
|
14
|
+
import isEqual from 'lodash/isEqual';
|
|
15
|
+
|
|
16
|
+
BrowserTestCase(
|
|
17
|
+
'multi cell table selection should correctly highlight entire table selection',
|
|
18
|
+
{ skip: ['chrome'] }, // https://product-fabric.atlassian.net/browse/DTR-330
|
|
19
|
+
async (client: any) => {
|
|
20
|
+
const page = await goToEditorTestingWDExample(
|
|
21
|
+
client,
|
|
22
|
+
'editor-plugin-table',
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
await mountEditor(page, {
|
|
26
|
+
appearance: fullpage.appearance,
|
|
27
|
+
allowTables: {
|
|
28
|
+
advanced: true,
|
|
29
|
+
},
|
|
30
|
+
defaultValue: tableWithTextAndEmptyRow,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
await multiCellTableSelectionTopLeftToBottomRight(page);
|
|
34
|
+
|
|
35
|
+
const selection = await page.execute(() => {
|
|
36
|
+
const view = (window as any).__editorView;
|
|
37
|
+
return view.state.selection;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const isMatch = isEqual(selection, { type: 'cell', anchor: 2, head: 97 });
|
|
41
|
+
expect(isMatch).toBe(true);
|
|
42
|
+
},
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
BrowserTestCase(
|
|
46
|
+
'multi cell table selection should correctly highlight table selection from the second row',
|
|
47
|
+
{ skip: ['chrome'] }, // https://product-fabric.atlassian.net/browse/DTR-330
|
|
48
|
+
async (client: any) => {
|
|
49
|
+
const page = await goToEditorTestingWDExample(
|
|
50
|
+
client,
|
|
51
|
+
'editor-plugin-table',
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
await mountEditor(page, {
|
|
55
|
+
appearance: fullpage.appearance,
|
|
56
|
+
allowTables: {
|
|
57
|
+
advanced: true,
|
|
58
|
+
},
|
|
59
|
+
defaultValue: tableWithTextAndEmptyRow,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
await multiCellTableSelectionBottomRightToFirstCell(page);
|
|
63
|
+
|
|
64
|
+
const selection = await page.execute(() => {
|
|
65
|
+
const view = (window as any).__editorView;
|
|
66
|
+
return view.state.selection;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const isMatch = isEqual(selection, { anchor: 97, head: 31, type: 'cell' });
|
|
70
|
+
expect(isMatch).toBe(true);
|
|
71
|
+
},
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
BrowserTestCase(
|
|
75
|
+
'multi cell table selection should correctly highlight table selection from the second column',
|
|
76
|
+
{ skip: ['chrome'] }, // https://product-fabric.atlassian.net/browse/DTR-330
|
|
77
|
+
async (client: any) => {
|
|
78
|
+
const page = await goToEditorTestingWDExample(
|
|
79
|
+
client,
|
|
80
|
+
'editor-plugin-table',
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
await mountEditor(page, {
|
|
84
|
+
appearance: fullpage.appearance,
|
|
85
|
+
allowTables: {
|
|
86
|
+
advanced: true,
|
|
87
|
+
},
|
|
88
|
+
defaultValue: tableWithTextAndEmptyRow,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
await multiCellTableSelectionBottomRightToMiddleTopCell(page);
|
|
92
|
+
|
|
93
|
+
const selection = await page.execute(() => {
|
|
94
|
+
const view = (window as any).__editorView;
|
|
95
|
+
return view.state.selection;
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const isMatch = isEqual(selection, { anchor: 97, head: 11, type: 'cell' });
|
|
99
|
+
expect(isMatch).toBe(true);
|
|
100
|
+
},
|
|
101
|
+
);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
editable,
|
|
5
|
+
getDocFromElement,
|
|
6
|
+
fullpage,
|
|
7
|
+
quickInsert,
|
|
8
|
+
insertBlockMenuItem,
|
|
9
|
+
} from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
10
|
+
import {
|
|
11
|
+
mountEditor,
|
|
12
|
+
goToEditorTestingWDExample,
|
|
13
|
+
} from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
14
|
+
|
|
15
|
+
const calendar = '[aria-label="calendar"]';
|
|
16
|
+
const nextDate = 'button[aria-selected=true] + button';
|
|
17
|
+
|
|
18
|
+
BrowserTestCase(
|
|
19
|
+
'change-date-inside-table.ts: Change date inside table',
|
|
20
|
+
{},
|
|
21
|
+
async (client: any, testName: string) => {
|
|
22
|
+
const page = await goToEditorTestingWDExample(
|
|
23
|
+
client,
|
|
24
|
+
'editor-plugin-table',
|
|
25
|
+
);
|
|
26
|
+
await mountEditor(page, {
|
|
27
|
+
appearance: fullpage.appearance,
|
|
28
|
+
allowDate: true,
|
|
29
|
+
allowTables: {
|
|
30
|
+
advanced: true,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
await page.click(editable);
|
|
35
|
+
|
|
36
|
+
// Insert table
|
|
37
|
+
await quickInsert(page, 'Table');
|
|
38
|
+
// Insert Date
|
|
39
|
+
await insertBlockMenuItem(page, 'Date');
|
|
40
|
+
expect(await page.isExisting(calendar)).toBe(true);
|
|
41
|
+
|
|
42
|
+
await page.click(nextDate);
|
|
43
|
+
|
|
44
|
+
const doc = await page.$eval(editable, getDocFromElement);
|
|
45
|
+
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
46
|
+
},
|
|
47
|
+
);
|