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 067907f commit 47ff1a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
/* 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 = 'name';
const newName = 'newName';

const selector = {
empty: '.ant-empty-normal',
Expand Down Expand Up @@ -51,11 +51,12 @@ 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.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 @@ -98,6 +99,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,8 @@
/* 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 = 'name';
const newName = 'newName';

const selector = {
empty: '.ant-empty-normal',
Expand Down Expand Up @@ -54,6 +54,7 @@ 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.get(selector.name).type(name);
Expand Down Expand Up @@ -105,6 +106,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 47ff1a9

Please sign in to comment.