Skip to content

Commit 47ff1a9

Browse files
authored
chore: Apply suggestion from code review.
1 parent 067907f commit 47ff1a9

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

web/cypress/integration/route/create-edit-route-with-redirect-plugin.spec.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
/* eslint-disable no-undef */
1818

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

2323
const selector = {
2424
empty: '.ant-empty-normal',
@@ -51,11 +51,12 @@ context('Create Edit and Delete Route with redirect plugin', () => {
5151
it('should create route with custom redirect plugin', function () {
5252
cy.visit('/');
5353
cy.contains('Route').click();
54+
cy.get(selector.empty).should('be.visible');
5455
cy.contains('Create').click();
5556
cy.contains('Next').click().click();
5657
cy.get(selector.name).type(name);
5758
cy.get(selector.redirect).click();
58-
cy.contains('Custom').click({ force: true });
59+
cy.contains('Custom').click();
5960
// after choose Custom option, Custom Redirect form field should be visible
6061
cy.get(selector.customRedirectLabel).should('be.visible');
6162
cy.get(selector.customRedirectUrI).should('be.visible');
@@ -98,6 +99,7 @@ context('Create Edit and Delete Route with redirect plugin', () => {
9899
cy.contains(data.submitSuccess);
99100
cy.contains('Goto List').click();
100101
cy.url().should('contains', 'routes/list');
102+
cy.contains(newName).should('be.visible');
101103
});
102104

103105
it('should delete the route', function () {

web/cypress/integration/route/create-edit-route-with-redirect-regex-plugin.spec.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
/* eslint-disable no-undef */
1818

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

2323
const selector = {
2424
empty: '.ant-empty-normal',
@@ -54,6 +54,7 @@ context('Create Edit and Delete Route with redirect plugin', () => {
5454
it('should create route with custom redirect plugin', function () {
5555
cy.visit('/');
5656
cy.contains('Route').click();
57+
cy.get(selector.empty).should('be.visible');
5758
cy.contains('Create').click();
5859
cy.contains('Next').click().click();
5960
cy.get(selector.name).type(name);
@@ -105,6 +106,7 @@ context('Create Edit and Delete Route with redirect plugin', () => {
105106
cy.contains(data.submitSuccess);
106107
cy.contains('Goto List').click();
107108
cy.url().should('contains', 'routes/list');
109+
cy.contains(newName).should('be.visible');
108110
});
109111

110112
it('should delete the route', function () {

0 commit comments

Comments
 (0)