add-cms
This commit is contained in:
1 parent
30106e0129
commit
0ae8d7a709
1044 files changed
+321581
No files matched your search
@@ -0,0 +1,93 @@
|
||||
import '../../utils/dismiss-local-backup';
|
||||
import {
|
||||
login,
|
||||
createPost,
|
||||
createPostAndExit,
|
||||
updateExistingPostAndExit,
|
||||
exitEditor,
|
||||
goToWorkflow,
|
||||
goToCollections,
|
||||
updateWorkflowStatus,
|
||||
publishWorkflowEntry,
|
||||
assertWorkflowStatusInEditor,
|
||||
assertPublishedEntry,
|
||||
deleteEntryInEditor,
|
||||
assertOnCollectionsPage,
|
||||
assertEntryDeleted,
|
||||
assertWorkflowStatus,
|
||||
updateWorkflowStatusInEditor,
|
||||
} from '../../utils/steps';
|
||||
import { workflowStatus, editorStatus } from '../../utils/constants';
|
||||
|
||||
export default function({ entries, getUser }) {
|
||||
it('successfully loads', () => {
|
||||
login(getUser());
|
||||
});
|
||||
|
||||
it('can create an entry', () => {
|
||||
login(getUser());
|
||||
createPostAndExit(entries[0]);
|
||||
});
|
||||
|
||||
it('can update an entry', () => {
|
||||
login(getUser());
|
||||
createPostAndExit(entries[0]);
|
||||
updateExistingPostAndExit(entries[0], entries[1]);
|
||||
});
|
||||
|
||||
it('can publish an editorial workflow entry', () => {
|
||||
login(getUser());
|
||||
createPostAndExit(entries[0]);
|
||||
goToWorkflow();
|
||||
updateWorkflowStatus(entries[0], workflowStatus.draft, workflowStatus.ready);
|
||||
publishWorkflowEntry(entries[0]);
|
||||
});
|
||||
|
||||
it('can change workflow status', () => {
|
||||
login(getUser());
|
||||
createPostAndExit(entries[0]);
|
||||
goToWorkflow();
|
||||
updateWorkflowStatus(entries[0], workflowStatus.draft, workflowStatus.review);
|
||||
updateWorkflowStatus(entries[0], workflowStatus.review, workflowStatus.ready);
|
||||
updateWorkflowStatus(entries[0], workflowStatus.ready, workflowStatus.review);
|
||||
updateWorkflowStatus(entries[0], workflowStatus.review, workflowStatus.draft);
|
||||
updateWorkflowStatus(entries[0], workflowStatus.draft, workflowStatus.ready);
|
||||
});
|
||||
|
||||
it('can change status on and publish multiple entries', () => {
|
||||
login(getUser());
|
||||
createPostAndExit(entries[0]);
|
||||
createPostAndExit(entries[1]);
|
||||
createPostAndExit(entries[2]);
|
||||
goToWorkflow();
|
||||
updateWorkflowStatus(entries[2], workflowStatus.draft, workflowStatus.ready);
|
||||
updateWorkflowStatus(entries[1], workflowStatus.draft, workflowStatus.ready);
|
||||
updateWorkflowStatus(entries[0], workflowStatus.draft, workflowStatus.ready);
|
||||
publishWorkflowEntry(entries[2]);
|
||||
publishWorkflowEntry(entries[1]);
|
||||
publishWorkflowEntry(entries[0]);
|
||||
goToCollections();
|
||||
assertPublishedEntry([entries[2], entries[1], entries[0]]);
|
||||
});
|
||||
|
||||
it('can delete an entry', () => {
|
||||
login(getUser());
|
||||
createPost(entries[0]);
|
||||
deleteEntryInEditor();
|
||||
assertOnCollectionsPage();
|
||||
assertEntryDeleted(entries[0]);
|
||||
});
|
||||
|
||||
it('can update workflow status from within the editor', () => {
|
||||
login(getUser());
|
||||
createPost(entries[0]);
|
||||
assertWorkflowStatusInEditor(editorStatus.draft);
|
||||
updateWorkflowStatusInEditor(editorStatus.review);
|
||||
assertWorkflowStatusInEditor(editorStatus.review);
|
||||
updateWorkflowStatusInEditor(editorStatus.ready);
|
||||
assertWorkflowStatusInEditor(editorStatus.ready);
|
||||
exitEditor();
|
||||
goToWorkflow();
|
||||
assertWorkflowStatus(entries[0], workflowStatus.ready);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import '../../utils/dismiss-local-backup';
|
||||
import {
|
||||
login,
|
||||
createPostAndExit,
|
||||
goToWorkflow,
|
||||
goToCollections,
|
||||
updateWorkflowStatus,
|
||||
publishWorkflowEntry,
|
||||
assertPublishedEntry,
|
||||
} from '../../utils/steps';
|
||||
import { workflowStatus } from '../../utils/constants';
|
||||
|
||||
const versions = ['2.9.7', '2.10.24'];
|
||||
|
||||
export default function({ entries, getUser }) {
|
||||
versions.forEach(version => {
|
||||
it(`migrate from ${version} to latest`, () => {
|
||||
cy.task('switchToVersion', {
|
||||
version,
|
||||
});
|
||||
cy.reload();
|
||||
|
||||
login(getUser());
|
||||
createPostAndExit(entries[0]);
|
||||
createPostAndExit(entries[1]);
|
||||
createPostAndExit(entries[2]);
|
||||
goToWorkflow();
|
||||
updateWorkflowStatus(entries[2], workflowStatus.draft, workflowStatus.ready);
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
cy.wait(1500); // older versions of the CMS didn't wait fully for the update to be resolved
|
||||
updateWorkflowStatus(entries[1], workflowStatus.draft, workflowStatus.ready);
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
cy.wait(1500); // older versions of the CMS didn't wait fully for the update to be resolved
|
||||
updateWorkflowStatus(entries[0], workflowStatus.draft, workflowStatus.ready);
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
cy.wait(1500); // older versions of the CMS didn't wait fully for the update to be resolved
|
||||
|
||||
cy.task('switchToVersion', {
|
||||
version: 'latest',
|
||||
});
|
||||
cy.reload();
|
||||
|
||||
// allow migration code to run for 5 minutes
|
||||
publishWorkflowEntry(entries[2], 5 * 60 * 1000);
|
||||
publishWorkflowEntry(entries[1]);
|
||||
publishWorkflowEntry(entries[0]);
|
||||
goToCollections();
|
||||
assertPublishedEntry([entries[2], entries[1], entries[0]]);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
export const entry1 = {
|
||||
title: 'first title',
|
||||
body: 'first body',
|
||||
description: 'first description',
|
||||
category: 'first category',
|
||||
tags: 'tag1',
|
||||
};
|
||||
export const entry2 = {
|
||||
title: 'second title',
|
||||
body: 'second body',
|
||||
description: 'second description',
|
||||
category: 'second category',
|
||||
tags: 'tag2',
|
||||
};
|
||||
export const entry3 = {
|
||||
title: 'third title',
|
||||
body: 'third body',
|
||||
description: 'third description',
|
||||
category: 'third category',
|
||||
tags: 'tag3',
|
||||
};
|
||||
Loaded 3 of 1044 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user