Make save_post_spec less affected by other E2E tests (#23541)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7a9a098ce4
Коммит
676a83b351
@@ -78,6 +78,7 @@ export function verifySavedPost(postId, message) {
|
|||||||
cy.findByText('Remove from Saved').scrollIntoView().should('be.visible');
|
cy.findByText('Remove from Saved').scrollIntoView().should('be.visible');
|
||||||
cy.get(`#CENTER_dropdown_${postId}`).should('be.visible').type('{esc}');
|
cy.get(`#CENTER_dropdown_${postId}`).should('be.visible').type('{esc}');
|
||||||
|
|
||||||
|
cy.get('#postListContent').within(() => {
|
||||||
// * Check that the post is highlighted
|
// * Check that the post is highlighted
|
||||||
cy.get(`#post_${postId}`).should('have.class', 'post--pinned-or-flagged');
|
cy.get(`#post_${postId}`).should('have.class', 'post--pinned-or-flagged');
|
||||||
|
|
||||||
@@ -98,6 +99,7 @@ export function verifySavedPost(postId, message) {
|
|||||||
within(() => {
|
within(() => {
|
||||||
cy.get('a').as('savedLink').should('be.visible');
|
cy.get('a').as('savedLink').should('be.visible');
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// * Check that the saved posts list is not open in RHS before clicking the link in the post pre-header
|
// * Check that the saved posts list is not open in RHS before clicking the link in the post pre-header
|
||||||
cy.get('#searchContainer').should('not.exist');
|
cy.get('#searchContainer').should('not.exist');
|
||||||
@@ -112,7 +114,7 @@ export function verifySavedPost(postId, message) {
|
|||||||
and('have.text', 'Saved Posts');
|
and('have.text', 'Saved Posts');
|
||||||
|
|
||||||
// * Check that the post pre-header is not shown for the saved message in RHS
|
// * Check that the post pre-header is not shown for the saved message in RHS
|
||||||
cy.get('#search-items-container').within(() => {
|
cy.get(`#searchResult_${postId}`).within(() => {
|
||||||
cy.get(`#rhsPostMessageText_${postId}`).contains(message);
|
cy.get(`#rhsPostMessageText_${postId}`).contains(message);
|
||||||
cy.get('div.post-pre-header').should('not.exist');
|
cy.get('div.post-pre-header').should('not.exist');
|
||||||
});
|
});
|
||||||
@@ -137,19 +139,21 @@ export function verifyUnsavedPost(postId) {
|
|||||||
cy.findByText('Save').scrollIntoView().should('be.visible');
|
cy.findByText('Save').scrollIntoView().should('be.visible');
|
||||||
cy.get(`#CENTER_dropdown_${postId}`).should('be.visible').type('{esc}');
|
cy.get(`#CENTER_dropdown_${postId}`).should('be.visible').type('{esc}');
|
||||||
|
|
||||||
// * Check that the post is highlighted
|
cy.get('#postListContent').within(() => {
|
||||||
|
// * Check that the post is not highlighted
|
||||||
cy.get(`#post_${postId}`).should('not.have.class', 'post--pinned-or-flagged');
|
cy.get(`#post_${postId}`).should('not.have.class', 'post--pinned-or-flagged');
|
||||||
|
|
||||||
// * Check that the post pre-header is visible
|
// * Check that the post pre-header is not visible
|
||||||
cy.get('div.post-pre-header').should('not.exist');
|
cy.get('div.post-pre-header').should('not.exist');
|
||||||
|
|
||||||
// * Check that the post pre-header has the saved icon
|
// * Check that the post pre-header does not have the saved icon
|
||||||
cy.get('span.icon--post-pre-header').
|
cy.get('span.icon--post-pre-header').
|
||||||
should('not.exist');
|
should('not.exist');
|
||||||
|
|
||||||
// * Check that the post pre-header has the saved post link
|
// * Check that the post pre-header does not have the saved post link
|
||||||
cy.get('div.post-pre-header__text-container').
|
cy.get('div.post-pre-header__text-container').
|
||||||
should('not.exist');
|
should('not.exist');
|
||||||
|
});
|
||||||
|
|
||||||
// * Check that the saved posts list is not open in RHS before clicking the link in the post pre-header
|
// * Check that the saved posts list is not open in RHS before clicking the link in the post pre-header
|
||||||
cy.get('#searchContainer').should('not.exist');
|
cy.get('#searchContainer').should('not.exist');
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user