docbrown/cypress/e2e/seededFlows/articleFlows/removeMainImage.spec.js
dependabot[bot] deb86efb0d
Bump cypress and @knapsack-pro/cypress (#18025)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-07-06 17:53:13 -04:00

32 lines
1 KiB
JavaScript

describe('Remove main image v2 editor', () => {
const title = 'Test Article';
beforeEach(() => {
cy.testSetup();
cy.fixture('users/articleEditorV2User.json').as('user');
cy.get('@user').then((user) => {
cy.loginUser(user).then(() => {
cy.createArticle({
title,
tags: ['beginner', 'ruby', 'go'],
content: `This is a test article's contents.`,
published: true,
mainImage:
'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/240/twitter/248/dog-face_1f436.png',
}).then((response) => {
cy.visitAndWaitForUserSideEffects(
`${response.body.current_state_path}/edit`,
);
});
});
});
});
describe("Removing the article's main/cover image", () => {
it('should successfully remove the image', () => {
cy.findByText('Remove').click();
cy.findByText('Save changes').click();
cy.findByAltText(`Cover image for ${title}`).should('not.exist');
});
});
});