Skip to content

Commit

Permalink
chore: Apply suggestion from code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
kj415j45 authored Dec 15, 2023
1 parent 255cdc0 commit aafb469
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ context('Create Edit and Delete Route with redirect plugin', () => {
it('should create route with custom redirect plugin', function () {
cy.visit('/');
cy.contains('Route').click();
cy.get(selector.empty).should('be.visible');
cy.contains('Create').click();
cy.wait(timeout * 2);
cy.contains('Next').click();
cy.contains('Next').click();
cy.get(selector.name).type(name);
cy.get(selector.redirect).click();
cy.contains('Custom').click({ force: true });
cy.contains('Custom').click();
// after choose Custom option, Custom Redirect form field should be visible
cy.get(selector.customRedirectLabel).should('be.visible');
cy.get(selector.customRedirectUrI).should('be.visible');
Expand Down Expand Up @@ -115,6 +116,7 @@ context('Create Edit and Delete Route with redirect plugin', () => {
cy.contains(data.submitSuccess);
cy.contains('Goto List').click();
cy.url().should('contains', 'routes/list');
cy.contains(newName).should('be.visible');
});

it('should delete the route', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
/* eslint-disable no-undef */

context('Create Edit and Delete Route with redirect plugin', () => {
const name = `${new Date().getFullYear()}-${new Date().getMonth() + 1}-${new Date().getDay()}`;
const newName = `${new Date().getFullYear()}*${new Date().getMonth() + 1}*${new Date().getDay()}`;
const name = `routeName${Date.now()}`;
const newName = `newName${Date.now()}`;
const timeout = 2000;

const selector = {
empty: '.ant-empty-normal',
Expand Down Expand Up @@ -54,8 +55,11 @@ context('Create Edit and Delete Route with redirect plugin', () => {
it('should create route with custom redirect plugin', function () {
cy.visit('/');
cy.contains('Route').click();
cy.get(selector.empty).should('be.visible');
cy.contains('Create').click();
cy.contains('Next').click().click();
cy.wait(timeout * 2);
cy.contains('Next').click();
cy.contains('Next').click();
cy.get(selector.name).type(name);
cy.get(selector.redirect).click();
cy.contains('Custom').click({ force: true });
Expand Down Expand Up @@ -105,6 +109,7 @@ context('Create Edit and Delete Route with redirect plugin', () => {
cy.contains(data.submitSuccess);
cy.contains('Goto List').click();
cy.url().should('contains', 'routes/list');
cy.contains(newName).should('be.visible');
});

it('should delete the route', function () {
Expand Down

0 comments on commit aafb469

Please sign in to comment.