Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Actions Component #4939

Merged
merged 9 commits into from
Jul 26, 2023
57 changes: 57 additions & 0 deletions cypress/tests/core/basic/actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
describe('actions Tests', () => {
beforeEach(() => {
cy.autologin();
cy.createContent({
contentType: 'Document',
contentId: 'my-page-1',
contentTitle: 'My Page-1',
allow_discussion: true,
}
);
cy.visit('/contents');
});
it('copy', function () {
cy.get('tr[aria-label="/my-page-1"]').within(() => {
cy.get('svg[class="icon dropdown-popup-trigger"]').click();
});
cy.get('a[class="item right-dropdown icon-align"]').eq(2).click();
cy.get('button[class="ui button icon item"]').click();
cy.visit('/contents');
cy.get('tr[aria-label="/copy_of_my-page-1"]').within(()=>{
cy.get('a[class="icon-align-name"]').should('have.attr', 'href', '/copy_of_my-page-1/contents');
})
});
it('delete', function () {
cy.get('tr[aria-label="/my-page-1"]').within(() => {
cy.get('button[class="ui basic icon button"]').click({ multiple: true });
});
cy.get('button[class="ui button icon item"]').eq(6).click();
cy.get('button[class="ui primary button"]').findByText('Delete').click();
cy.visit('/contents');
cy.get('tr').should('not.contain','/my-page-1');

});
it('cut', function () {
cy.get('tr[aria-label="/my-page-1"]').within(() => {
cy.get('svg[class="icon dropdown-popup-trigger"]').click();
});
cy.get('a[class="item right-dropdown icon-align"]').eq(1).click();
cy.get('button[class="ui button icon item"]').click();
cy.visit('/contents');
cy.get('tr[aria-label="/my-page-1"]').within(()=>{
cy.get('a[class="icon-align-name"]').should('have.attr', 'href', '/my-page-1/contents');
})
});
it('rename', function () {
cy.get('tr[aria-label="/my-page-1"]').within(() => {
cy.get('button[class="ui basic icon button"]').click({ multiple: true });
});
cy.get('button[class="ui button icon item"]').eq(0).click();
cy.get('#field-0_title').clear().type('my-page-rename');
cy.get('#field-0_id').clear().type('my-page-rename');
cy.get('button[class="ui basic circular primary right floated button"]').click();
cy.get('tr[aria-label="/my-page-rename"]').within(()=>{
cy.get('a[class="icon-align-name"]').should('have.attr', 'href', '/my-page-rename/contents');
})
})
});
1 change: 1 addition & 0 deletions news/4939.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refactor Actions-@Tishasoumya-02
Loading