@atlaskit/editor-common 70.1.2 → 70.1.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 +6 -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/ui/DropList/index.js +1 -1
- package/dist/cjs/version.json +1 -1
- 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/ui/DropList/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- 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/ui/DropList/index.js +1 -1
- package/dist/esm/version.json +1 -1
- 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/in-product.d.ts +1 -1
- package/dist/types/ui-menu/ToolbarButton/index.d.ts +1 -1
- 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/in-product.d.ts +1 -1
- package/dist/types-ts4.0/ui-menu/ToolbarButton/index.d.ts +1 -1
- package/package.json +4 -5
- 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/types.js +0 -5
- 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/types.js +0 -1
- 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/types.js +0 -1
- 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
package/CHANGELOG.md
CHANGED
|
@@ -39,17 +39,9 @@ Object.defineProperty(exports, "inlineSmartLinksTestCollection", {
|
|
|
39
39
|
return _smartLinks.inlineSmartLinksTestCollection;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
Object.defineProperty(exports, "mediaTestCollection", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function get() {
|
|
45
|
-
return _testCases.mediaTestCollection;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
42
|
|
|
49
43
|
var _Editor = require("./page-objects/Editor");
|
|
50
44
|
|
|
51
45
|
var _collection = require("./cases/fundamentals/collection");
|
|
52
46
|
|
|
53
|
-
var _smartLinks = require("./cases/smart-links");
|
|
54
|
-
|
|
55
|
-
var _testCases = require("./cases/media/test-cases");
|
|
47
|
+
var _smartLinks = require("./cases/smart-links");
|
|
@@ -57,13 +57,6 @@ var EditorPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
|
|
|
57
57
|
|
|
58
58
|
throw Error('No publish button selector supplied!');
|
|
59
59
|
}
|
|
60
|
-
}, {
|
|
61
|
-
key: "upload",
|
|
62
|
-
value: function upload(fixtures) {
|
|
63
|
-
return this.getEditorArea().attachFile(fixtures, {
|
|
64
|
-
subjectType: 'drag-n-drop'
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
60
|
}]);
|
|
68
61
|
return EditorPageObject;
|
|
69
62
|
}(_inProductTesting.InProductTestPageObject);
|
|
@@ -110,8 +110,14 @@ var EditorSmartLinkPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
|
|
|
110
110
|
}, {
|
|
111
111
|
key: "insertSmartLinkByTyping",
|
|
112
112
|
value: function insertSmartLinkByTyping(url) {
|
|
113
|
-
|
|
113
|
+
var _this2 = this;
|
|
114
|
+
|
|
115
|
+
return this.editor.getEditorArea().type("".concat(url, " "), {
|
|
114
116
|
delay: 0
|
|
117
|
+
}).get('p>a').type('{leftArrow}{leftArrow}').get('[aria-label="Floating Toolbar"]').then(function () {
|
|
118
|
+
_this2.openViewSwitcher();
|
|
119
|
+
|
|
120
|
+
_this2.selectViewSwitcherOption('inline');
|
|
115
121
|
});
|
|
116
122
|
}
|
|
117
123
|
}, {
|
|
@@ -43,15 +43,6 @@ var RendererPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
|
|
|
43
43
|
value: function expectContentReady() {
|
|
44
44
|
return this.cy.get('.ak-renderer-document').should('be.visible');
|
|
45
45
|
}
|
|
46
|
-
}, {
|
|
47
|
-
key: "expectMediaSingleRenders",
|
|
48
|
-
value: function expectMediaSingleRenders(numOfMedia) {
|
|
49
|
-
var _this = this;
|
|
50
|
-
|
|
51
|
-
return this.cy.get('.rich-media-item').should('have.length', numOfMedia).each(function (element) {
|
|
52
|
-
_this.cy.wrap(element).should('have.attr', 'data-layout', 'center').should('have.attr', 'data-node-type', 'mediaSingle').should('be.visible');
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
46
|
}]);
|
|
56
47
|
return RendererPageObject;
|
|
57
48
|
}(_inProductTesting.InProductTestPageObject);
|
package/dist/cjs/in-product.js
CHANGED
|
@@ -39,11 +39,5 @@ Object.defineProperty(exports, "inlineSmartLinksTestCollection", {
|
|
|
39
39
|
return _tests_external__.inlineSmartLinksTestCollection;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
Object.defineProperty(exports, "mediaTestCollection", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function get() {
|
|
45
|
-
return _tests_external__.mediaTestCollection;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
42
|
|
|
49
43
|
var _tests_external__ = require("./__tests_external__");
|
|
@@ -46,7 +46,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
46
46
|
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; } }
|
|
47
47
|
|
|
48
48
|
var packageName = "@atlaskit/editor-common";
|
|
49
|
-
var packageVersion = "70.1.
|
|
49
|
+
var packageVersion = "70.1.3";
|
|
50
50
|
var halfFocusRing = 1;
|
|
51
51
|
var dropOffset = "0, ".concat((0, _constants.gridSize)(), "px");
|
|
52
52
|
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { EditorPageObject } from './page-objects/Editor';
|
|
2
2
|
export { fundamentalsTestCollection } from './cases/fundamentals/collection';
|
|
3
|
-
export { inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection, blueLinksTestCollection } from './cases/smart-links';
|
|
4
|
-
export { mediaTestCollection } from './cases/media/test-cases';
|
|
3
|
+
export { inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection, blueLinksTestCollection } from './cases/smart-links';
|
|
@@ -68,8 +68,11 @@ export class EditorSmartLinkPageObject extends InProductTestPageObject {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
insertSmartLinkByTyping(url) {
|
|
71
|
-
return this.editor.getEditorArea().
|
|
71
|
+
return this.editor.getEditorArea().type(`${url} `, {
|
|
72
72
|
delay: 0
|
|
73
|
+
}).get('p>a').type('{leftArrow}{leftArrow}').get('[aria-label="Floating Toolbar"]').then(() => {
|
|
74
|
+
this.openViewSwitcher();
|
|
75
|
+
this.selectViewSwitcherOption('inline');
|
|
73
76
|
});
|
|
74
77
|
}
|
|
75
78
|
|
|
@@ -8,10 +8,4 @@ export class RendererPageObject extends InProductTestPageObject {
|
|
|
8
8
|
return this.cy.get('.ak-renderer-document').should('be.visible');
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
expectMediaSingleRenders(numOfMedia) {
|
|
12
|
-
return this.cy.get('.rich-media-item').should('have.length', numOfMedia).each(element => {
|
|
13
|
-
this.cy.wrap(element).should('have.attr', 'data-layout', 'center').should('have.attr', 'data-node-type', 'mediaSingle').should('be.visible');
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { fundamentalsTestCollection, blueLinksTestCollection, inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection,
|
|
1
|
+
export { fundamentalsTestCollection, blueLinksTestCollection, inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection, EditorPageObject } from './__tests_external__';
|
|
@@ -10,7 +10,7 @@ import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
|
10
10
|
import { token } from '@atlaskit/tokens';
|
|
11
11
|
import Layer from '../Layer';
|
|
12
12
|
const packageName = "@atlaskit/editor-common";
|
|
13
|
-
const packageVersion = "70.1.
|
|
13
|
+
const packageVersion = "70.1.3";
|
|
14
14
|
const halfFocusRing = 1;
|
|
15
15
|
const dropOffset = `0, ${gridSize()}px`;
|
|
16
16
|
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { EditorPageObject } from './page-objects/Editor';
|
|
2
2
|
export { fundamentalsTestCollection } from './cases/fundamentals/collection';
|
|
3
|
-
export { inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection, blueLinksTestCollection } from './cases/smart-links';
|
|
4
|
-
export { mediaTestCollection } from './cases/media/test-cases';
|
|
3
|
+
export { inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection, blueLinksTestCollection } from './cases/smart-links';
|
|
@@ -43,13 +43,6 @@ export var EditorPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
|
|
|
43
43
|
|
|
44
44
|
throw Error('No publish button selector supplied!');
|
|
45
45
|
}
|
|
46
|
-
}, {
|
|
47
|
-
key: "upload",
|
|
48
|
-
value: function upload(fixtures) {
|
|
49
|
-
return this.getEditorArea().attachFile(fixtures, {
|
|
50
|
-
subjectType: 'drag-n-drop'
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
46
|
}]);
|
|
54
47
|
|
|
55
48
|
return EditorPageObject;
|
|
@@ -97,8 +97,14 @@ export var EditorSmartLinkPageObject = /*#__PURE__*/function (_InProductTestPage
|
|
|
97
97
|
}, {
|
|
98
98
|
key: "insertSmartLinkByTyping",
|
|
99
99
|
value: function insertSmartLinkByTyping(url) {
|
|
100
|
-
|
|
100
|
+
var _this2 = this;
|
|
101
|
+
|
|
102
|
+
return this.editor.getEditorArea().type("".concat(url, " "), {
|
|
101
103
|
delay: 0
|
|
104
|
+
}).get('p>a').type('{leftArrow}{leftArrow}').get('[aria-label="Floating Toolbar"]').then(function () {
|
|
105
|
+
_this2.openViewSwitcher();
|
|
106
|
+
|
|
107
|
+
_this2.selectViewSwitcherOption('inline');
|
|
102
108
|
});
|
|
103
109
|
}
|
|
104
110
|
}, {
|
|
@@ -30,15 +30,6 @@ export var RendererPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
|
|
|
30
30
|
value: function expectContentReady() {
|
|
31
31
|
return this.cy.get('.ak-renderer-document').should('be.visible');
|
|
32
32
|
}
|
|
33
|
-
}, {
|
|
34
|
-
key: "expectMediaSingleRenders",
|
|
35
|
-
value: function expectMediaSingleRenders(numOfMedia) {
|
|
36
|
-
var _this = this;
|
|
37
|
-
|
|
38
|
-
return this.cy.get('.rich-media-item').should('have.length', numOfMedia).each(function (element) {
|
|
39
|
-
_this.cy.wrap(element).should('have.attr', 'data-layout', 'center').should('have.attr', 'data-node-type', 'mediaSingle').should('be.visible');
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
33
|
}]);
|
|
43
34
|
|
|
44
35
|
return RendererPageObject;
|
package/dist/esm/in-product.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { fundamentalsTestCollection, blueLinksTestCollection, inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection,
|
|
1
|
+
export { fundamentalsTestCollection, blueLinksTestCollection, inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection, EditorPageObject } from './__tests_external__';
|
|
@@ -23,7 +23,7 @@ import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
|
23
23
|
import { token } from '@atlaskit/tokens';
|
|
24
24
|
import Layer from '../Layer';
|
|
25
25
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "70.1.
|
|
26
|
+
var packageVersion = "70.1.3";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = "0, ".concat(gridSize(), "px");
|
|
29
29
|
|
package/dist/esm/version.json
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { EditorPageObject } from './page-objects/Editor';
|
|
2
2
|
export { fundamentalsTestCollection } from './cases/fundamentals/collection';
|
|
3
3
|
export { inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection, blueLinksTestCollection, } from './cases/smart-links';
|
|
4
|
-
export { mediaTestCollection } from './cases/media/test-cases';
|
|
@@ -6,5 +6,4 @@ export declare class EditorPageObject extends InProductTestPageObject {
|
|
|
6
6
|
getEditorArea(): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
7
7
|
getTitleArea(): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
8
8
|
publish(opts: EditorTestCaseOpts['ui']): RendererPageObject;
|
|
9
|
-
upload(fixtures: string[]): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
10
9
|
}
|
|
@@ -3,5 +3,4 @@ import { InProductTestPageObject } from '@atlaskit/in-product-testing';
|
|
|
3
3
|
export declare class RendererPageObject extends InProductTestPageObject {
|
|
4
4
|
getContent(): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
5
5
|
expectContentReady(): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
6
|
-
expectMediaSingleRenders(numOfMedia: number): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
7
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { fundamentalsTestCollection, blueLinksTestCollection, inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection,
|
|
1
|
+
export { fundamentalsTestCollection, blueLinksTestCollection, inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection, EditorPageObject, } from './__tests_external__';
|
|
@@ -39,7 +39,7 @@ declare const ToolbarButton: React.ForwardRefExoticComponent<{
|
|
|
39
39
|
onClick?: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
|
|
40
40
|
onItemClick?: ((item: MenuItem) => void) | undefined;
|
|
41
41
|
selected?: boolean | undefined;
|
|
42
|
-
spacing?: "
|
|
42
|
+
spacing?: "none" | "default" | "compact" | undefined;
|
|
43
43
|
target?: string | undefined;
|
|
44
44
|
title?: React.ReactNode;
|
|
45
45
|
titlePosition?: PositionType | undefined;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { EditorPageObject } from './page-objects/Editor';
|
|
2
2
|
export { fundamentalsTestCollection } from './cases/fundamentals/collection';
|
|
3
3
|
export { inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection, blueLinksTestCollection, } from './cases/smart-links';
|
|
4
|
-
export { mediaTestCollection } from './cases/media/test-cases';
|
|
@@ -6,5 +6,4 @@ export declare class EditorPageObject extends InProductTestPageObject {
|
|
|
6
6
|
getEditorArea(): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
7
7
|
getTitleArea(): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
8
8
|
publish(opts: EditorTestCaseOpts['ui']): RendererPageObject;
|
|
9
|
-
upload(fixtures: string[]): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
10
9
|
}
|
|
@@ -3,5 +3,4 @@ import { InProductTestPageObject } from '@atlaskit/in-product-testing';
|
|
|
3
3
|
export declare class RendererPageObject extends InProductTestPageObject {
|
|
4
4
|
getContent(): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
5
5
|
expectContentReady(): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
6
|
-
expectMediaSingleRenders(numOfMedia: number): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
7
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { fundamentalsTestCollection, blueLinksTestCollection, inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection,
|
|
1
|
+
export { fundamentalsTestCollection, blueLinksTestCollection, inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection, EditorPageObject, } from './__tests_external__';
|
|
@@ -39,7 +39,7 @@ declare const ToolbarButton: React.ForwardRefExoticComponent<{
|
|
|
39
39
|
onClick?: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
|
|
40
40
|
onItemClick?: ((item: MenuItem) => void) | undefined;
|
|
41
41
|
selected?: boolean | undefined;
|
|
42
|
-
spacing?: "
|
|
42
|
+
spacing?: "none" | "default" | "compact" | undefined;
|
|
43
43
|
target?: string | undefined;
|
|
44
44
|
title?: React.ReactNode;
|
|
45
45
|
titlePosition?: PositionType | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "70.1.
|
|
3
|
+
"version": "70.1.3",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"typesVersions": {
|
|
16
16
|
">=4.0 <4.5": {
|
|
17
17
|
"*": [
|
|
18
|
-
"dist/types-ts4.0/*"
|
|
18
|
+
"dist/types-ts4.0/*",
|
|
19
|
+
"dist/types-ts4.0/index.d.ts"
|
|
19
20
|
]
|
|
20
21
|
}
|
|
21
22
|
},
|
|
@@ -84,7 +85,7 @@
|
|
|
84
85
|
"@atlaskit/mention": "^21.0.0",
|
|
85
86
|
"@atlaskit/menu": "^1.3.0",
|
|
86
87
|
"@atlaskit/profilecard": "^17.2.0",
|
|
87
|
-
"@atlaskit/smart-card": "^23.
|
|
88
|
+
"@atlaskit/smart-card": "^23.1.0",
|
|
88
89
|
"@atlaskit/smart-user-picker": "^6.0.0",
|
|
89
90
|
"@atlaskit/task-decision": "^17.5.0",
|
|
90
91
|
"@atlaskit/theme": "^12.2.0",
|
|
@@ -100,7 +101,6 @@
|
|
|
100
101
|
"@types/prosemirror-view": "^1.9.0",
|
|
101
102
|
"chromatism": "^2.6.0",
|
|
102
103
|
"classnames": "^2.2.5",
|
|
103
|
-
"cypress-file-upload": "^5.0.2",
|
|
104
104
|
"date-fns": "^2.17.0",
|
|
105
105
|
"lodash": "^4.17.21",
|
|
106
106
|
"popper.js": "^1.14.1",
|
|
@@ -129,7 +129,6 @@
|
|
|
129
129
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
130
130
|
"@testing-library/react": "^12.1.5",
|
|
131
131
|
"@types/raf-schd": "^4.0.1",
|
|
132
|
-
"cypress-file-upload": "^5.0.2",
|
|
133
132
|
"enzyme": "^3.10.0",
|
|
134
133
|
"raf-stub": "^2.0.1",
|
|
135
134
|
"react": "^16.8.0",
|
package/tsconfig.json
CHANGED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.addAltTextMediaTestCase = void 0;
|
|
7
|
-
|
|
8
|
-
var _inProductTesting = require("@atlaskit/in-product-testing");
|
|
9
|
-
|
|
10
|
-
var _inProduct = require("@atlaskit/media-card/in-product");
|
|
11
|
-
|
|
12
|
-
var _Editor = require("../../../page-objects/Editor");
|
|
13
|
-
|
|
14
|
-
var _EditorMedia = require("../../../page-objects/EditorMedia");
|
|
15
|
-
|
|
16
|
-
var addAltTextMediaTestCase = function addAltTextMediaTestCase(_ref) {
|
|
17
|
-
var ui = _ref.ui,
|
|
18
|
-
fixtures = _ref.fixtures;
|
|
19
|
-
return new _inProductTesting.InProductTestCase({
|
|
20
|
-
title: 'adding alt text to Media works',
|
|
21
|
-
id: 'media-alt-text',
|
|
22
|
-
precondition: function precondition() {
|
|
23
|
-
return fixtures.length > 0;
|
|
24
|
-
},
|
|
25
|
-
assertions: function assertions(cy) {
|
|
26
|
-
var editor = new _Editor.EditorPageObject(cy);
|
|
27
|
-
var editorMedia = new _EditorMedia.EditorMediaPageObject(cy);
|
|
28
|
-
var mediaCard = new _inProduct.MediaCardPageObject(cy);
|
|
29
|
-
editor.upload(fixtures);
|
|
30
|
-
mediaCard.expectCardReady(fixtures.length);
|
|
31
|
-
var altText = 'Corne **loves** avocados';
|
|
32
|
-
editorMedia.addAltTextToImage(altText);
|
|
33
|
-
editorMedia.assertAltText(altText);
|
|
34
|
-
|
|
35
|
-
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
36
|
-
var renderer = editor.publish(ui);
|
|
37
|
-
renderer.expectContentReady();
|
|
38
|
-
renderer.expectMediaSingleRenders(fixtures.length);
|
|
39
|
-
mediaCard.assertAltText(altText);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
exports.addAltTextMediaTestCase = addAltTextMediaTestCase;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.addCaptionMediaTestCase = void 0;
|
|
7
|
-
|
|
8
|
-
var _inProductTesting = require("@atlaskit/in-product-testing");
|
|
9
|
-
|
|
10
|
-
var _inProduct = require("@atlaskit/media-card/in-product");
|
|
11
|
-
|
|
12
|
-
var _Editor = require("../../../page-objects/Editor");
|
|
13
|
-
|
|
14
|
-
var _EditorMedia = require("../../../page-objects/EditorMedia");
|
|
15
|
-
|
|
16
|
-
var addCaptionMediaTestCase = function addCaptionMediaTestCase(_ref) {
|
|
17
|
-
var ui = _ref.ui,
|
|
18
|
-
fixtures = _ref.fixtures;
|
|
19
|
-
return new _inProductTesting.InProductTestCase({
|
|
20
|
-
title: 'adding caption to Media works',
|
|
21
|
-
id: 'media-caption',
|
|
22
|
-
precondition: function precondition() {
|
|
23
|
-
return fixtures.length > 0;
|
|
24
|
-
},
|
|
25
|
-
assertions: function assertions(cy) {
|
|
26
|
-
var editor = new _Editor.EditorPageObject(cy);
|
|
27
|
-
var editorMedia = new _EditorMedia.EditorMediaPageObject(cy);
|
|
28
|
-
var mediaCard = new _inProduct.MediaCardPageObject(cy);
|
|
29
|
-
editor.upload(fixtures);
|
|
30
|
-
mediaCard.expectCardReady(fixtures.length);
|
|
31
|
-
var captionText = 'Corne loves avocados';
|
|
32
|
-
editorMedia.addCaptionToImage(captionText);
|
|
33
|
-
|
|
34
|
-
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
35
|
-
var renderer = editor.publish(ui);
|
|
36
|
-
renderer.expectContentReady();
|
|
37
|
-
renderer.expectMediaSingleRenders(fixtures.length);
|
|
38
|
-
editorMedia.assertCaptionText(captionText);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
exports.addCaptionMediaTestCase = addCaptionMediaTestCase;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.mediaTestCollection = void 0;
|
|
7
|
-
|
|
8
|
-
var _inProductTesting = require("@atlaskit/in-product-testing");
|
|
9
|
-
|
|
10
|
-
var _altText = require("./alt-text");
|
|
11
|
-
|
|
12
|
-
var _caption = require("./caption");
|
|
13
|
-
|
|
14
|
-
var _upload = require("./upload");
|
|
15
|
-
|
|
16
|
-
var mediaTestCollection = function mediaTestCollection(opts) {
|
|
17
|
-
return new _inProductTesting.InProductTestCollection({
|
|
18
|
-
title: '@atlaskit/editor-core -> Media, happy paths',
|
|
19
|
-
testCases: [(0, _upload.uploadMediaTestCase)(opts), (0, _altText.addAltTextMediaTestCase)(opts), (0, _caption.addCaptionMediaTestCase)(opts)]
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
exports.mediaTestCollection = mediaTestCollection;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.uploadMediaTestCase = void 0;
|
|
7
|
-
|
|
8
|
-
var _inProductTesting = require("@atlaskit/in-product-testing");
|
|
9
|
-
|
|
10
|
-
var _inProduct = require("@atlaskit/media-card/in-product");
|
|
11
|
-
|
|
12
|
-
var _Editor = require("../../../page-objects/Editor");
|
|
13
|
-
|
|
14
|
-
var uploadMediaTestCase = function uploadMediaTestCase(_ref) {
|
|
15
|
-
var ui = _ref.ui,
|
|
16
|
-
fixtures = _ref.fixtures;
|
|
17
|
-
return new _inProductTesting.InProductTestCase({
|
|
18
|
-
title: 'media upload and publish works',
|
|
19
|
-
id: 'media-file-upload',
|
|
20
|
-
precondition: function precondition() {
|
|
21
|
-
return fixtures.length > 0;
|
|
22
|
-
},
|
|
23
|
-
assertions: function assertions(cy) {
|
|
24
|
-
var editor = new _Editor.EditorPageObject(cy);
|
|
25
|
-
var mediaCard = new _inProduct.MediaCardPageObject(cy);
|
|
26
|
-
editor.upload(fixtures);
|
|
27
|
-
mediaCard.expectCardReady(fixtures.length);
|
|
28
|
-
|
|
29
|
-
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
30
|
-
var renderer = editor.publish(ui);
|
|
31
|
-
renderer.expectContentReady();
|
|
32
|
-
renderer.expectMediaSingleRenders(fixtures.length);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
exports.uploadMediaTestCase = uploadMediaTestCase;
|
|
@@ -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 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -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 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -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';
|