@atlaskit/editor-common 70.1.2 → 70.2.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.
- package/CHANGELOG.md +40 -0
- package/dist/cjs/__tests_external__/index.js +1 -9
- package/dist/cjs/__tests_external__/page-objects/Editor.js +0 -7
- package/dist/cjs/__tests_external__/page-objects/EditorSmartLink.js +7 -1
- package/dist/cjs/__tests_external__/page-objects/Renderer.js +0 -9
- package/dist/cjs/in-product.js +0 -6
- package/dist/cjs/react-node-view/index.js +19 -17
- package/dist/cjs/styles/index.js +12 -0
- package/dist/cjs/styles/shared/code-block.js +5 -3
- package/dist/cjs/styles/shared/lists.js +4 -2
- package/dist/cjs/styles/shared/table.js +1 -1
- package/dist/cjs/{__tests_external__/cases/media/test-cases/types.js → types/copy-button.js} +0 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Expand/index.js +2 -2
- package/dist/cjs/ui/IntlProviderIfMissingWrapper/index.js +33 -0
- package/dist/cjs/ui/Popup/index.js +2 -2
- package/dist/cjs/ui/PortalProvider/index.js +62 -47
- package/dist/cjs/ui/index.js +8 -0
- package/dist/cjs/utils/breakout.js +53 -2
- package/dist/cjs/utils/collab.js +22 -0
- package/dist/cjs/utils/dom.js +16 -0
- package/dist/cjs/utils/get-performance-options.js +70 -0
- package/dist/cjs/utils/index.js +57 -1
- package/dist/cjs/utils/outdated-browsers.js +41 -0
- package/dist/cjs/utils/referentiality.js +49 -0
- package/dist/cjs/utils/sendLogs.js +19 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/with-plugin-state/index.js +61 -54
- package/dist/es2019/__tests_external__/index.js +1 -2
- package/dist/es2019/__tests_external__/page-objects/Editor.js +0 -6
- package/dist/es2019/__tests_external__/page-objects/EditorSmartLink.js +4 -1
- package/dist/es2019/__tests_external__/page-objects/Renderer.js +0 -6
- package/dist/es2019/in-product.js +1 -1
- package/dist/es2019/react-node-view/index.js +19 -24
- package/dist/es2019/styles/index.js +2 -2
- package/dist/es2019/styles/shared/code-block.js +13 -1
- package/dist/es2019/styles/shared/lists.js +2 -1
- package/dist/es2019/styles/shared/table.js +4 -2
- package/dist/es2019/{__tests_external__/cases/media/test-cases/types.js → types/copy-button.js} +0 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Expand/index.js +17 -15
- package/dist/es2019/ui/IntlProviderIfMissingWrapper/index.js +18 -0
- package/dist/es2019/ui/Popup/index.js +2 -1
- package/dist/es2019/ui/PortalProvider/index.js +33 -14
- package/dist/es2019/ui/index.js +2 -1
- package/dist/es2019/utils/breakout.js +47 -1
- package/dist/es2019/utils/collab.js +13 -0
- package/dist/es2019/utils/dom.js +16 -0
- package/dist/es2019/utils/get-performance-options.js +57 -0
- package/dist/es2019/utils/index.js +6 -2
- package/dist/es2019/utils/outdated-browsers.js +32 -0
- package/dist/es2019/utils/referentiality.js +34 -0
- package/dist/es2019/utils/sendLogs.js +8 -0
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/with-plugin-state/index.js +55 -52
- package/dist/esm/__tests_external__/index.js +1 -2
- package/dist/esm/__tests_external__/page-objects/Editor.js +0 -7
- package/dist/esm/__tests_external__/page-objects/EditorSmartLink.js +7 -1
- package/dist/esm/__tests_external__/page-objects/Renderer.js +0 -9
- package/dist/esm/in-product.js +1 -1
- package/dist/esm/react-node-view/index.js +19 -22
- package/dist/esm/styles/index.js +2 -2
- package/dist/esm/styles/shared/code-block.js +4 -3
- package/dist/esm/styles/shared/lists.js +2 -1
- package/dist/esm/styles/shared/table.js +1 -1
- package/dist/esm/{__tests_external__/cases/media/test-cases/types.js → types/copy-button.js} +0 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Expand/index.js +2 -2
- package/dist/esm/ui/IntlProviderIfMissingWrapper/index.js +19 -0
- package/dist/esm/ui/Popup/index.js +2 -2
- package/dist/esm/ui/PortalProvider/index.js +59 -48
- package/dist/esm/ui/index.js +2 -1
- package/dist/esm/utils/breakout.js +46 -1
- package/dist/esm/utils/collab.js +13 -0
- package/dist/esm/utils/dom.js +16 -0
- package/dist/esm/utils/get-performance-options.js +55 -0
- package/dist/esm/utils/index.js +6 -2
- package/dist/esm/utils/outdated-browsers.js +32 -0
- package/dist/esm/utils/referentiality.js +40 -0
- package/dist/esm/utils/sendLogs.js +10 -0
- package/dist/esm/version.json +1 -1
- package/dist/esm/with-plugin-state/index.js +59 -54
- package/dist/types/__tests_external__/index.d.ts +0 -1
- package/dist/types/__tests_external__/page-objects/Editor.d.ts +0 -1
- package/dist/types/__tests_external__/page-objects/Renderer.d.ts +0 -1
- package/dist/types/analytics/types/events.d.ts +1 -0
- package/dist/types/extensions/types/extension-handler.d.ts +1 -0
- package/dist/types/in-product.d.ts +1 -1
- package/dist/types/styles/index.d.ts +2 -2
- package/dist/types/styles/shared/code-block.d.ts +1 -0
- package/dist/types/styles/shared/lists.d.ts +1 -0
- package/dist/types/types/copy-button.d.ts +20 -0
- package/dist/types/types/editor-actions.d.ts +1 -0
- package/dist/types/types/editor-container-width.d.ts +14 -0
- package/dist/types/types/feature-flags.d.ts +0 -6
- package/dist/types/types/floating-toolbar.d.ts +23 -2
- package/dist/types/types/index.d.ts +2 -1
- package/dist/types/ui/IntlProviderIfMissingWrapper/index.d.ts +6 -0
- package/dist/types/ui/Popup/index.d.ts +1 -0
- package/dist/types/ui/PortalProvider/index.d.ts +2 -1
- package/dist/types/ui/index.d.ts +1 -0
- package/dist/types/ui-menu/ToolbarButton/index.d.ts +1 -1
- package/dist/types/utils/breakout.d.ts +25 -0
- package/dist/types/utils/collab.d.ts +2 -0
- package/dist/types/utils/dom.d.ts +15 -1
- package/dist/types/utils/get-performance-options.d.ts +18 -0
- package/dist/types/utils/getModeFromTheme.d.ts +1 -1
- package/dist/types/utils/index.d.ts +5 -1
- package/dist/types/utils/outdated-browsers.d.ts +1 -0
- package/dist/types/utils/referentiality.d.ts +3 -0
- package/dist/types/utils/sendLogs.d.ts +1 -0
- package/dist/types/with-plugin-state/index.d.ts +4 -2
- package/dist/types-ts4.0/__tests_external__/index.d.ts +0 -1
- package/dist/types-ts4.0/__tests_external__/page-objects/Editor.d.ts +0 -1
- package/dist/types-ts4.0/__tests_external__/page-objects/Renderer.d.ts +0 -1
- package/dist/types-ts4.0/analytics/types/events.d.ts +1 -0
- package/dist/types-ts4.0/extensions/types/extension-handler.d.ts +1 -0
- package/dist/types-ts4.0/in-product.d.ts +1 -1
- package/dist/types-ts4.0/styles/index.d.ts +2 -2
- package/dist/types-ts4.0/styles/shared/code-block.d.ts +1 -0
- package/dist/types-ts4.0/styles/shared/lists.d.ts +1 -0
- package/dist/types-ts4.0/types/copy-button.d.ts +20 -0
- package/dist/types-ts4.0/types/editor-actions.d.ts +1 -0
- package/dist/types-ts4.0/types/editor-container-width.d.ts +14 -0
- package/dist/types-ts4.0/types/feature-flags.d.ts +0 -6
- package/dist/types-ts4.0/types/floating-toolbar.d.ts +23 -2
- package/dist/types-ts4.0/types/index.d.ts +2 -1
- package/dist/types-ts4.0/ui/IntlProviderIfMissingWrapper/index.d.ts +6 -0
- package/dist/types-ts4.0/ui/Popup/index.d.ts +1 -0
- package/dist/types-ts4.0/ui/PortalProvider/index.d.ts +2 -1
- package/dist/types-ts4.0/ui/index.d.ts +1 -0
- package/dist/types-ts4.0/ui-menu/ToolbarButton/index.d.ts +1 -1
- package/dist/types-ts4.0/utils/breakout.d.ts +25 -0
- package/dist/types-ts4.0/utils/collab.d.ts +2 -0
- package/dist/types-ts4.0/utils/dom.d.ts +15 -1
- package/dist/types-ts4.0/utils/get-performance-options.d.ts +18 -0
- package/dist/types-ts4.0/utils/getModeFromTheme.d.ts +1 -1
- package/dist/types-ts4.0/utils/index.d.ts +5 -1
- package/dist/types-ts4.0/utils/outdated-browsers.d.ts +1 -0
- package/dist/types-ts4.0/utils/referentiality.d.ts +3 -0
- package/dist/types-ts4.0/utils/sendLogs.d.ts +1 -0
- package/dist/types-ts4.0/with-plugin-state/index.d.ts +4 -2
- package/package.json +12 -10
- package/report.api.md +7 -3
- package/tsconfig.json +2 -1
- package/dist/cjs/__tests_external__/cases/media/test-cases/alt-text.js +0 -45
- package/dist/cjs/__tests_external__/cases/media/test-cases/caption.js +0 -44
- package/dist/cjs/__tests_external__/cases/media/test-cases/index.js +0 -23
- package/dist/cjs/__tests_external__/cases/media/test-cases/upload.js +0 -38
- package/dist/cjs/__tests_external__/page-objects/EditorMedia.js +0 -98
- package/dist/cjs/cypress-config.js +0 -3
- package/dist/es2019/__tests_external__/cases/media/test-cases/alt-text.js +0 -29
- package/dist/es2019/__tests_external__/cases/media/test-cases/caption.js +0 -28
- package/dist/es2019/__tests_external__/cases/media/test-cases/index.js +0 -8
- package/dist/es2019/__tests_external__/cases/media/test-cases/upload.js +0 -23
- package/dist/es2019/__tests_external__/page-objects/EditorMedia.js +0 -51
- package/dist/es2019/cypress-config.js +0 -1
- package/dist/esm/__tests_external__/cases/media/test-cases/alt-text.js +0 -32
- package/dist/esm/__tests_external__/cases/media/test-cases/caption.js +0 -31
- package/dist/esm/__tests_external__/cases/media/test-cases/index.js +0 -10
- package/dist/esm/__tests_external__/cases/media/test-cases/upload.js +0 -26
- package/dist/esm/__tests_external__/page-objects/EditorMedia.js +0 -83
- package/dist/esm/cypress-config.js +0 -1
- package/dist/types/__tests_external__/cases/media/test-cases/alt-text.d.ts +0 -3
- package/dist/types/__tests_external__/cases/media/test-cases/caption.d.ts +0 -3
- package/dist/types/__tests_external__/cases/media/test-cases/index.d.ts +0 -3
- package/dist/types/__tests_external__/cases/media/test-cases/types.d.ts +0 -4
- package/dist/types/__tests_external__/cases/media/test-cases/upload.d.ts +0 -7
- package/dist/types/__tests_external__/page-objects/EditorMedia.d.ts +0 -19
- package/dist/types/cypress-config.d.ts +0 -1
- package/dist/types-ts4.0/__tests_external__/cases/media/test-cases/alt-text.d.ts +0 -3
- package/dist/types-ts4.0/__tests_external__/cases/media/test-cases/caption.d.ts +0 -3
- package/dist/types-ts4.0/__tests_external__/cases/media/test-cases/index.d.ts +0 -3
- package/dist/types-ts4.0/__tests_external__/cases/media/test-cases/types.d.ts +0 -4
- package/dist/types-ts4.0/__tests_external__/cases/media/test-cases/upload.d.ts +0 -7
- package/dist/types-ts4.0/__tests_external__/page-objects/EditorMedia.d.ts +0 -19
- package/dist/types-ts4.0/cypress-config.d.ts +0 -1
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.EditorMediaPageObject = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
-
|
|
16
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
-
|
|
20
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
-
|
|
22
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
|
|
24
|
-
var _inProductTesting = require("@atlaskit/in-product-testing");
|
|
25
|
-
|
|
26
|
-
var _inProduct = require("@atlaskit/media-card/in-product");
|
|
27
|
-
|
|
28
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
29
|
-
|
|
30
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
31
|
-
|
|
32
|
-
var EditorMediaPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
|
|
33
|
-
(0, _inherits2.default)(EditorMediaPageObject, _InProductTestPageObj);
|
|
34
|
-
|
|
35
|
-
var _super = _createSuper(EditorMediaPageObject);
|
|
36
|
-
|
|
37
|
-
function EditorMediaPageObject(cy) {
|
|
38
|
-
var _this;
|
|
39
|
-
|
|
40
|
-
(0, _classCallCheck2.default)(this, EditorMediaPageObject);
|
|
41
|
-
_this = _super.call(this, cy);
|
|
42
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "testIds", {
|
|
43
|
-
altTextButton: 'alt-text-edit-button',
|
|
44
|
-
altTextInput: 'alt-text-input',
|
|
45
|
-
captionPlaceholder: 'caption-placeholder',
|
|
46
|
-
caption: 'media-caption'
|
|
47
|
-
});
|
|
48
|
-
_this.cy = cy;
|
|
49
|
-
return _this;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
(0, _createClass2.default)(EditorMediaPageObject, [{
|
|
53
|
-
key: "addAltTextToImage",
|
|
54
|
-
value: function addAltTextToImage(altText) {
|
|
55
|
-
var cardNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
56
|
-
var mediaCard = new _inProduct.MediaCardPageObject(this.cy);
|
|
57
|
-
mediaCard.findCardNth(cardNumber).click();
|
|
58
|
-
this.getAltTextButton().click();
|
|
59
|
-
this.getAltTextInput().type("".concat(altText, "{enter}"));
|
|
60
|
-
}
|
|
61
|
-
}, {
|
|
62
|
-
key: "addCaptionToImage",
|
|
63
|
-
value: function addCaptionToImage(captionText) {
|
|
64
|
-
var cardNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
65
|
-
var mediaCard = new _inProduct.MediaCardPageObject(this.cy);
|
|
66
|
-
mediaCard.findCardNth(cardNumber).click();
|
|
67
|
-
this.getCaptionInput().type("".concat(captionText, "{enter}"));
|
|
68
|
-
}
|
|
69
|
-
}, {
|
|
70
|
-
key: "assertCaptionText",
|
|
71
|
-
value: function assertCaptionText(captionText) {
|
|
72
|
-
return this.cy.get(this.toTestId(this.testIds.caption)).should('have.text', captionText);
|
|
73
|
-
}
|
|
74
|
-
}, {
|
|
75
|
-
key: "assertAltText",
|
|
76
|
-
value: function assertAltText(altText) {
|
|
77
|
-
return this.cy.get('.mediaView-content-wrap').should('have.attr', 'alt', altText);
|
|
78
|
-
}
|
|
79
|
-
}, {
|
|
80
|
-
key: "getAltTextButton",
|
|
81
|
-
value: function getAltTextButton() {
|
|
82
|
-
return this.cy.get(this.toTestId(this.testIds.altTextButton)).should('be.visible');
|
|
83
|
-
}
|
|
84
|
-
}, {
|
|
85
|
-
key: "getAltTextInput",
|
|
86
|
-
value: function getAltTextInput() {
|
|
87
|
-
return this.cy.get(this.toTestId(this.testIds.altTextInput)).should('be.visible');
|
|
88
|
-
}
|
|
89
|
-
}, {
|
|
90
|
-
key: "getCaptionInput",
|
|
91
|
-
value: function getCaptionInput() {
|
|
92
|
-
return this.cy.get(this.toTestId(this.testIds.captionPlaceholder)).should('be.visible');
|
|
93
|
-
}
|
|
94
|
-
}]);
|
|
95
|
-
return EditorMediaPageObject;
|
|
96
|
-
}(_inProductTesting.InProductTestPageObject);
|
|
97
|
-
|
|
98
|
-
exports.EditorMediaPageObject = EditorMediaPageObject;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
-
import { MediaCardPageObject } from '@atlaskit/media-card/in-product';
|
|
3
|
-
import { EditorPageObject } from '../../../page-objects/Editor';
|
|
4
|
-
import { EditorMediaPageObject } from '../../../page-objects/EditorMedia';
|
|
5
|
-
export const addAltTextMediaTestCase = ({
|
|
6
|
-
ui,
|
|
7
|
-
fixtures
|
|
8
|
-
}) => new InProductTestCase({
|
|
9
|
-
title: 'adding alt text to Media works',
|
|
10
|
-
id: 'media-alt-text',
|
|
11
|
-
precondition: () => fixtures.length > 0,
|
|
12
|
-
assertions: cy => {
|
|
13
|
-
const editor = new EditorPageObject(cy);
|
|
14
|
-
const editorMedia = new EditorMediaPageObject(cy);
|
|
15
|
-
const mediaCard = new MediaCardPageObject(cy);
|
|
16
|
-
editor.upload(fixtures);
|
|
17
|
-
mediaCard.expectCardReady(fixtures.length);
|
|
18
|
-
const altText = 'Corne **loves** avocados';
|
|
19
|
-
editorMedia.addAltTextToImage(altText);
|
|
20
|
-
editorMedia.assertAltText(altText);
|
|
21
|
-
|
|
22
|
-
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
23
|
-
const renderer = editor.publish(ui);
|
|
24
|
-
renderer.expectContentReady();
|
|
25
|
-
renderer.expectMediaSingleRenders(fixtures.length);
|
|
26
|
-
mediaCard.assertAltText(altText);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
-
import { MediaCardPageObject } from '@atlaskit/media-card/in-product';
|
|
3
|
-
import { EditorPageObject } from '../../../page-objects/Editor';
|
|
4
|
-
import { EditorMediaPageObject } from '../../../page-objects/EditorMedia';
|
|
5
|
-
export const addCaptionMediaTestCase = ({
|
|
6
|
-
ui,
|
|
7
|
-
fixtures
|
|
8
|
-
}) => new InProductTestCase({
|
|
9
|
-
title: 'adding caption to Media works',
|
|
10
|
-
id: 'media-caption',
|
|
11
|
-
precondition: () => fixtures.length > 0,
|
|
12
|
-
assertions: cy => {
|
|
13
|
-
const editor = new EditorPageObject(cy);
|
|
14
|
-
const editorMedia = new EditorMediaPageObject(cy);
|
|
15
|
-
const mediaCard = new MediaCardPageObject(cy);
|
|
16
|
-
editor.upload(fixtures);
|
|
17
|
-
mediaCard.expectCardReady(fixtures.length);
|
|
18
|
-
const captionText = 'Corne loves avocados';
|
|
19
|
-
editorMedia.addCaptionToImage(captionText);
|
|
20
|
-
|
|
21
|
-
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
22
|
-
const renderer = editor.publish(ui);
|
|
23
|
-
renderer.expectContentReady();
|
|
24
|
-
renderer.expectMediaSingleRenders(fixtures.length);
|
|
25
|
-
editorMedia.assertCaptionText(captionText);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { InProductTestCollection } from '@atlaskit/in-product-testing';
|
|
2
|
-
import { addAltTextMediaTestCase } from './alt-text';
|
|
3
|
-
import { addCaptionMediaTestCase } from './caption';
|
|
4
|
-
import { uploadMediaTestCase } from './upload';
|
|
5
|
-
export const mediaTestCollection = opts => new InProductTestCollection({
|
|
6
|
-
title: '@atlaskit/editor-core -> Media, happy paths',
|
|
7
|
-
testCases: [uploadMediaTestCase(opts), addAltTextMediaTestCase(opts), addCaptionMediaTestCase(opts)]
|
|
8
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
-
import { MediaCardPageObject } from '@atlaskit/media-card/in-product';
|
|
3
|
-
import { EditorPageObject } from '../../../page-objects/Editor';
|
|
4
|
-
export const uploadMediaTestCase = ({
|
|
5
|
-
ui,
|
|
6
|
-
fixtures
|
|
7
|
-
}) => new InProductTestCase({
|
|
8
|
-
title: 'media upload and publish works',
|
|
9
|
-
id: 'media-file-upload',
|
|
10
|
-
precondition: () => fixtures.length > 0,
|
|
11
|
-
assertions: cy => {
|
|
12
|
-
const editor = new EditorPageObject(cy);
|
|
13
|
-
const mediaCard = new MediaCardPageObject(cy);
|
|
14
|
-
editor.upload(fixtures);
|
|
15
|
-
mediaCard.expectCardReady(fixtures.length);
|
|
16
|
-
|
|
17
|
-
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
18
|
-
const renderer = editor.publish(ui);
|
|
19
|
-
renderer.expectContentReady();
|
|
20
|
-
renderer.expectMediaSingleRenders(fixtures.length);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { InProductTestPageObject } from '@atlaskit/in-product-testing';
|
|
3
|
-
import { MediaCardPageObject } from '@atlaskit/media-card/in-product';
|
|
4
|
-
export class EditorMediaPageObject extends InProductTestPageObject {
|
|
5
|
-
constructor(cy) {
|
|
6
|
-
super(cy);
|
|
7
|
-
|
|
8
|
-
_defineProperty(this, "testIds", {
|
|
9
|
-
altTextButton: 'alt-text-edit-button',
|
|
10
|
-
altTextInput: 'alt-text-input',
|
|
11
|
-
captionPlaceholder: 'caption-placeholder',
|
|
12
|
-
caption: 'media-caption'
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
this.cy = cy;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
addAltTextToImage(altText, cardNumber = 1) {
|
|
19
|
-
const mediaCard = new MediaCardPageObject(this.cy);
|
|
20
|
-
mediaCard.findCardNth(cardNumber).click();
|
|
21
|
-
this.getAltTextButton().click();
|
|
22
|
-
this.getAltTextInput().type(`${altText}{enter}`);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
addCaptionToImage(captionText, cardNumber = 1) {
|
|
26
|
-
const mediaCard = new MediaCardPageObject(this.cy);
|
|
27
|
-
mediaCard.findCardNth(cardNumber).click();
|
|
28
|
-
this.getCaptionInput().type(`${captionText}{enter}`);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
assertCaptionText(captionText) {
|
|
32
|
-
return this.cy.get(this.toTestId(this.testIds.caption)).should('have.text', captionText);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
assertAltText(altText) {
|
|
36
|
-
return this.cy.get('.mediaView-content-wrap').should('have.attr', 'alt', altText);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
getAltTextButton() {
|
|
40
|
-
return this.cy.get(this.toTestId(this.testIds.altTextButton)).should('be.visible');
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
getAltTextInput() {
|
|
44
|
-
return this.cy.get(this.toTestId(this.testIds.altTextInput)).should('be.visible');
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
getCaptionInput() {
|
|
48
|
-
return this.cy.get(this.toTestId(this.testIds.captionPlaceholder)).should('be.visible');
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'cypress-file-upload';
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
-
import { MediaCardPageObject } from '@atlaskit/media-card/in-product';
|
|
3
|
-
import { EditorPageObject } from '../../../page-objects/Editor';
|
|
4
|
-
import { EditorMediaPageObject } from '../../../page-objects/EditorMedia';
|
|
5
|
-
export var addAltTextMediaTestCase = function addAltTextMediaTestCase(_ref) {
|
|
6
|
-
var ui = _ref.ui,
|
|
7
|
-
fixtures = _ref.fixtures;
|
|
8
|
-
return new InProductTestCase({
|
|
9
|
-
title: 'adding alt text to Media works',
|
|
10
|
-
id: 'media-alt-text',
|
|
11
|
-
precondition: function precondition() {
|
|
12
|
-
return fixtures.length > 0;
|
|
13
|
-
},
|
|
14
|
-
assertions: function assertions(cy) {
|
|
15
|
-
var editor = new EditorPageObject(cy);
|
|
16
|
-
var editorMedia = new EditorMediaPageObject(cy);
|
|
17
|
-
var mediaCard = new MediaCardPageObject(cy);
|
|
18
|
-
editor.upload(fixtures);
|
|
19
|
-
mediaCard.expectCardReady(fixtures.length);
|
|
20
|
-
var altText = 'Corne **loves** avocados';
|
|
21
|
-
editorMedia.addAltTextToImage(altText);
|
|
22
|
-
editorMedia.assertAltText(altText);
|
|
23
|
-
|
|
24
|
-
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
25
|
-
var renderer = editor.publish(ui);
|
|
26
|
-
renderer.expectContentReady();
|
|
27
|
-
renderer.expectMediaSingleRenders(fixtures.length);
|
|
28
|
-
mediaCard.assertAltText(altText);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
-
import { MediaCardPageObject } from '@atlaskit/media-card/in-product';
|
|
3
|
-
import { EditorPageObject } from '../../../page-objects/Editor';
|
|
4
|
-
import { EditorMediaPageObject } from '../../../page-objects/EditorMedia';
|
|
5
|
-
export var addCaptionMediaTestCase = function addCaptionMediaTestCase(_ref) {
|
|
6
|
-
var ui = _ref.ui,
|
|
7
|
-
fixtures = _ref.fixtures;
|
|
8
|
-
return new InProductTestCase({
|
|
9
|
-
title: 'adding caption to Media works',
|
|
10
|
-
id: 'media-caption',
|
|
11
|
-
precondition: function precondition() {
|
|
12
|
-
return fixtures.length > 0;
|
|
13
|
-
},
|
|
14
|
-
assertions: function assertions(cy) {
|
|
15
|
-
var editor = new EditorPageObject(cy);
|
|
16
|
-
var editorMedia = new EditorMediaPageObject(cy);
|
|
17
|
-
var mediaCard = new MediaCardPageObject(cy);
|
|
18
|
-
editor.upload(fixtures);
|
|
19
|
-
mediaCard.expectCardReady(fixtures.length);
|
|
20
|
-
var captionText = 'Corne loves avocados';
|
|
21
|
-
editorMedia.addCaptionToImage(captionText);
|
|
22
|
-
|
|
23
|
-
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
24
|
-
var renderer = editor.publish(ui);
|
|
25
|
-
renderer.expectContentReady();
|
|
26
|
-
renderer.expectMediaSingleRenders(fixtures.length);
|
|
27
|
-
editorMedia.assertCaptionText(captionText);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { InProductTestCollection } from '@atlaskit/in-product-testing';
|
|
2
|
-
import { addAltTextMediaTestCase } from './alt-text';
|
|
3
|
-
import { addCaptionMediaTestCase } from './caption';
|
|
4
|
-
import { uploadMediaTestCase } from './upload';
|
|
5
|
-
export var mediaTestCollection = function mediaTestCollection(opts) {
|
|
6
|
-
return new InProductTestCollection({
|
|
7
|
-
title: '@atlaskit/editor-core -> Media, happy paths',
|
|
8
|
-
testCases: [uploadMediaTestCase(opts), addAltTextMediaTestCase(opts), addCaptionMediaTestCase(opts)]
|
|
9
|
-
});
|
|
10
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
-
import { MediaCardPageObject } from '@atlaskit/media-card/in-product';
|
|
3
|
-
import { EditorPageObject } from '../../../page-objects/Editor';
|
|
4
|
-
export var uploadMediaTestCase = function uploadMediaTestCase(_ref) {
|
|
5
|
-
var ui = _ref.ui,
|
|
6
|
-
fixtures = _ref.fixtures;
|
|
7
|
-
return new InProductTestCase({
|
|
8
|
-
title: 'media upload and publish works',
|
|
9
|
-
id: 'media-file-upload',
|
|
10
|
-
precondition: function precondition() {
|
|
11
|
-
return fixtures.length > 0;
|
|
12
|
-
},
|
|
13
|
-
assertions: function assertions(cy) {
|
|
14
|
-
var editor = new EditorPageObject(cy);
|
|
15
|
-
var mediaCard = new MediaCardPageObject(cy);
|
|
16
|
-
editor.upload(fixtures);
|
|
17
|
-
mediaCard.expectCardReady(fixtures.length);
|
|
18
|
-
|
|
19
|
-
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
20
|
-
var renderer = editor.publish(ui);
|
|
21
|
-
renderer.expectContentReady();
|
|
22
|
-
renderer.expectMediaSingleRenders(fixtures.length);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
|
-
import { InProductTestPageObject } from '@atlaskit/in-product-testing';
|
|
14
|
-
import { MediaCardPageObject } from '@atlaskit/media-card/in-product';
|
|
15
|
-
export var EditorMediaPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
|
|
16
|
-
_inherits(EditorMediaPageObject, _InProductTestPageObj);
|
|
17
|
-
|
|
18
|
-
var _super = _createSuper(EditorMediaPageObject);
|
|
19
|
-
|
|
20
|
-
function EditorMediaPageObject(cy) {
|
|
21
|
-
var _this;
|
|
22
|
-
|
|
23
|
-
_classCallCheck(this, EditorMediaPageObject);
|
|
24
|
-
|
|
25
|
-
_this = _super.call(this, cy);
|
|
26
|
-
|
|
27
|
-
_defineProperty(_assertThisInitialized(_this), "testIds", {
|
|
28
|
-
altTextButton: 'alt-text-edit-button',
|
|
29
|
-
altTextInput: 'alt-text-input',
|
|
30
|
-
captionPlaceholder: 'caption-placeholder',
|
|
31
|
-
caption: 'media-caption'
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
_this.cy = cy;
|
|
35
|
-
return _this;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
_createClass(EditorMediaPageObject, [{
|
|
39
|
-
key: "addAltTextToImage",
|
|
40
|
-
value: function addAltTextToImage(altText) {
|
|
41
|
-
var cardNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
42
|
-
var mediaCard = new MediaCardPageObject(this.cy);
|
|
43
|
-
mediaCard.findCardNth(cardNumber).click();
|
|
44
|
-
this.getAltTextButton().click();
|
|
45
|
-
this.getAltTextInput().type("".concat(altText, "{enter}"));
|
|
46
|
-
}
|
|
47
|
-
}, {
|
|
48
|
-
key: "addCaptionToImage",
|
|
49
|
-
value: function addCaptionToImage(captionText) {
|
|
50
|
-
var cardNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
51
|
-
var mediaCard = new MediaCardPageObject(this.cy);
|
|
52
|
-
mediaCard.findCardNth(cardNumber).click();
|
|
53
|
-
this.getCaptionInput().type("".concat(captionText, "{enter}"));
|
|
54
|
-
}
|
|
55
|
-
}, {
|
|
56
|
-
key: "assertCaptionText",
|
|
57
|
-
value: function assertCaptionText(captionText) {
|
|
58
|
-
return this.cy.get(this.toTestId(this.testIds.caption)).should('have.text', captionText);
|
|
59
|
-
}
|
|
60
|
-
}, {
|
|
61
|
-
key: "assertAltText",
|
|
62
|
-
value: function assertAltText(altText) {
|
|
63
|
-
return this.cy.get('.mediaView-content-wrap').should('have.attr', 'alt', altText);
|
|
64
|
-
}
|
|
65
|
-
}, {
|
|
66
|
-
key: "getAltTextButton",
|
|
67
|
-
value: function getAltTextButton() {
|
|
68
|
-
return this.cy.get(this.toTestId(this.testIds.altTextButton)).should('be.visible');
|
|
69
|
-
}
|
|
70
|
-
}, {
|
|
71
|
-
key: "getAltTextInput",
|
|
72
|
-
value: function getAltTextInput() {
|
|
73
|
-
return this.cy.get(this.toTestId(this.testIds.altTextInput)).should('be.visible');
|
|
74
|
-
}
|
|
75
|
-
}, {
|
|
76
|
-
key: "getCaptionInput",
|
|
77
|
-
value: function getCaptionInput() {
|
|
78
|
-
return this.cy.get(this.toTestId(this.testIds.captionPlaceholder)).should('be.visible');
|
|
79
|
-
}
|
|
80
|
-
}]);
|
|
81
|
-
|
|
82
|
-
return EditorMediaPageObject;
|
|
83
|
-
}(InProductTestPageObject);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'cypress-file-upload';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
-
import { EditorTestCaseOpts } from '../../types';
|
|
3
|
-
interface EditorMediaTestCaseOpts extends EditorTestCaseOpts {
|
|
4
|
-
fixtures: string[];
|
|
5
|
-
}
|
|
6
|
-
export declare const uploadMediaTestCase: ({ ui, fixtures, }: EditorMediaTestCaseOpts) => InProductTestCase;
|
|
7
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
import { CypressType, InProductTestPageObject } from '@atlaskit/in-product-testing';
|
|
3
|
-
export declare class EditorMediaPageObject extends InProductTestPageObject {
|
|
4
|
-
protected cy: CypressType;
|
|
5
|
-
constructor(cy: CypressType);
|
|
6
|
-
testIds: {
|
|
7
|
-
altTextButton: string;
|
|
8
|
-
altTextInput: string;
|
|
9
|
-
captionPlaceholder: string;
|
|
10
|
-
caption: string;
|
|
11
|
-
};
|
|
12
|
-
addAltTextToImage(altText: string, cardNumber?: number): void;
|
|
13
|
-
addCaptionToImage(captionText: string, cardNumber?: number): void;
|
|
14
|
-
assertCaptionText(captionText: string): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
15
|
-
assertAltText(altText: string): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
16
|
-
private getAltTextButton;
|
|
17
|
-
private getAltTextInput;
|
|
18
|
-
private getCaptionInput;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'cypress-file-upload';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
-
import { EditorTestCaseOpts } from '../../types';
|
|
3
|
-
interface EditorMediaTestCaseOpts extends EditorTestCaseOpts {
|
|
4
|
-
fixtures: string[];
|
|
5
|
-
}
|
|
6
|
-
export declare const uploadMediaTestCase: ({ ui, fixtures, }: EditorMediaTestCaseOpts) => InProductTestCase;
|
|
7
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
import { CypressType, InProductTestPageObject } from '@atlaskit/in-product-testing';
|
|
3
|
-
export declare class EditorMediaPageObject extends InProductTestPageObject {
|
|
4
|
-
protected cy: CypressType;
|
|
5
|
-
constructor(cy: CypressType);
|
|
6
|
-
testIds: {
|
|
7
|
-
altTextButton: string;
|
|
8
|
-
altTextInput: string;
|
|
9
|
-
captionPlaceholder: string;
|
|
10
|
-
caption: string;
|
|
11
|
-
};
|
|
12
|
-
addAltTextToImage(altText: string, cardNumber?: number): void;
|
|
13
|
-
addCaptionToImage(captionText: string, cardNumber?: number): void;
|
|
14
|
-
assertCaptionText(captionText: string): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
15
|
-
assertAltText(altText: string): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
16
|
-
private getAltTextButton;
|
|
17
|
-
private getAltTextInput;
|
|
18
|
-
private getCaptionInput;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'cypress-file-upload';
|