.dependabot
.github
.storybook
cypress
fixtures
integration
common
editorial_workflow_migration_spec_github_backend_rest.js
editorial_workflow_spec_bitbucket_backend.js
editorial_workflow_spec_git-gateway_github_backend.js
editorial_workflow_spec_git-gateway_gitlab_backend.js
editorial_workflow_spec_github_backend_graphql.js
editorial_workflow_spec_github_backend_graphql_open_authoring.js
editorial_workflow_spec_github_backend_rest.js
editorial_workflow_spec_github_backend_rest_open_authoring.js
editorial_workflow_spec_gitlab_backend.js
editorial_workflow_spec_proxy_git_backend.js
editorial_workflow_spec_test_backend.js
field_validations_spec.js
i18n_editorial_workflow_spec_test_backend.js
i18n_simple_workflow_spec_proxy_fs_backend.js
markdown_widget_backspace_spec.js
markdown_widget_code_block_spec.js
markdown_widget_enter_spec.js
markdown_widget_hotkeys_spec.js
markdown_widget_link_spec.js
markdown_widget_list_spec.js
markdown_widget_marks_spec.js
markdown_widget_quote_spec.js
media_library_spec_bitbucket_backend.js
media_library_spec_bitbucket_backend_large_media.js
media_library_spec_git-gateway_github_backend_large_media.js
media_library_spec_git-gateway_gitlab_backend_large_media.js
media_library_spec_github_backend_graphql.js
media_library_spec_github_backend_rest.js
media_library_spec_gitlab_backend.js
media_library_spec_proxy_git_backend.js
media_library_spec_test_backend.js
search_suggestion_spec.js
simple_workflow_spec_bitbucket_backend.js
simple_workflow_spec_git-gateway_github_backend.js
simple_workflow_spec_git-gateway_gitlab_backend.js
simple_workflow_spec_github_backend_graphql.js
simple_workflow_spec_github_backend_rest.js
simple_workflow_spec_gitlab_backend.js
simple_workflow_spec_proxy_fs_backend.js
simple_workflow_spec_proxy_git_backend.js
simple_workflow_spec_test_backend.js
view_filters_spec.js
view_groups_spec.js
plugins
snapshots
support
utils
Readme.md
dev-test
functions
img
packages
scripts
website
.all-contributorsrc
.editorconfig
.eslintrc.js
.gitignore
.nvmrc
.prettierignore
.prettierrc
.stylelintrc
.vale.ini
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
babel.config.js
commitlint.config.js
cypress.json
jest.config.js
lerna.json
netlify.toml
package.json
renovate.json
setupTestFramework.js
tsconfig.json
yarn.lock
103 lines
2.3 KiB
JavaScript
103 lines
2.3 KiB
JavaScript
import '../utils/dismiss-local-backup';
|
|
import {
|
|
login,
|
|
newPost,
|
|
populateEntry,
|
|
exitEditor,
|
|
createPostAndPublish,
|
|
assertPublishedEntry,
|
|
editPostAndPublish,
|
|
createPostPublishAndCreateNew,
|
|
createPostPublishAndDuplicate,
|
|
editPostPublishAndCreateNew,
|
|
editPostPublishAndDuplicate,
|
|
duplicatePostAndPublish,
|
|
} from '../utils/steps';
|
|
|
|
const entry1 = {
|
|
title: 'first title',
|
|
body: 'first body',
|
|
};
|
|
const entry2 = {
|
|
title: 'second title',
|
|
body: 'second body',
|
|
};
|
|
|
|
const backend = 'test';
|
|
|
|
describe('Test Backend Simple Workflow', () => {
|
|
before(() => {
|
|
Cypress.config('defaultCommandTimeout', 4000);
|
|
cy.task('setupBackend', { backend, options: { publish_mode: 'simple' } });
|
|
});
|
|
|
|
after(() => {
|
|
cy.task('teardownBackend', { backend });
|
|
});
|
|
|
|
it('successfully loads', () => {
|
|
login();
|
|
});
|
|
|
|
it('can create a new entry', () => {
|
|
login();
|
|
newPost();
|
|
populateEntry(entry1, () => {});
|
|
|
|
// new entry should show 'Unsaved changes'
|
|
cy.contains('div', 'Unsaved Changes');
|
|
cy.url().should('eq', `http://localhost:8080/#/collections/posts/new`);
|
|
exitEditor();
|
|
});
|
|
|
|
it('can publish a new entry', () => {
|
|
login();
|
|
createPostAndPublish(entry1);
|
|
assertPublishedEntry(entry1);
|
|
});
|
|
|
|
it('can publish a new entry and create new', () => {
|
|
login();
|
|
createPostPublishAndCreateNew(entry1);
|
|
assertPublishedEntry(entry1);
|
|
});
|
|
|
|
it('can publish a new entry and duplicate', () => {
|
|
login();
|
|
createPostPublishAndDuplicate(entry1);
|
|
assertPublishedEntry(entry1);
|
|
});
|
|
|
|
it('can edit an existing entry and publish', () => {
|
|
login();
|
|
createPostAndPublish(entry1);
|
|
assertPublishedEntry(entry1);
|
|
|
|
editPostAndPublish(entry1, entry2);
|
|
});
|
|
|
|
it('can edit an existing entry, publish and create new', () => {
|
|
login();
|
|
createPostAndPublish(entry1);
|
|
assertPublishedEntry(entry1);
|
|
|
|
editPostPublishAndCreateNew(entry1, entry2);
|
|
});
|
|
|
|
it('can edit an existing entry, publish and duplicate', () => {
|
|
login();
|
|
createPostAndPublish(entry1);
|
|
assertPublishedEntry(entry1);
|
|
|
|
editPostPublishAndDuplicate(entry1, entry2);
|
|
});
|
|
|
|
it('can duplicate an existing entry', () => {
|
|
login();
|
|
createPostAndPublish(entry1);
|
|
assertPublishedEntry(entry1);
|
|
|
|
duplicatePostAndPublish(entry1);
|
|
});
|
|
});
|