feat: workflow unpublished entry (#2914)

* feat: workflow unpublished entry

* fix: post rebase fix - load unpublished entry after unpublish

* feat: change unpublish button to dropdown

* test(cypress): add unpublish entry cypress test
This commit is contained in:
Bartholomew
2019-11-26 11:14:04 +01:00
committed by Erez Rokah
parent 465f463959
commit 41bb9aac0d
10 changed files with 121 additions and 5 deletions

View File

@ -5,6 +5,7 @@ const setting2 = { name: 'Andrew Wommack', description: 'A Gospel Teacher' };
const notifications = {
saved: 'Entry saved',
published: 'Entry published',
unpublished: 'Entry unpublished',
updated: 'Entry status updated',
deletedUnpublished: 'Unpublished changes deleted',
error: {

View File

@ -212,6 +212,23 @@ function updateExistingPostAndExit(fromEntry, toEntry) {
cy.contains('h2', toEntry.title);
}
function unpublishEntry(entry) {
goToCollections();
cy.contains('h2', entry.title)
.parent()
.click({ force: true });
cy.contains('[role="button"]', 'Published').as('publishedButton');
cy.get('@publishedButton')
.parent()
.within(() => {
cy.get('@publishedButton').click();
cy.contains('[role="menuitem"] span', 'Unpublish').click();
});
assertNotification(notifications.unpublished);
goToWorkflow();
assertWorkflowStatus(entry, workflowStatus.ready);
}
function validateObjectFields({ limit, author }) {
cy.get('a[href^="#/collections/settings"]').click();
cy.get('a[href^="#/collections/settings/entries/general"]').click();
@ -303,4 +320,5 @@ module.exports = {
validateObjectFieldsAndExit,
validateNestedObjectFieldsAndExit,
validateListFieldsAndExit,
unpublishEntry,
};