PickwickSoft / innovedu

Unnecessary type assertion of an expression JS-0349
Anti-pattern
Major
2 years ago2 years old
This assertion is unnecessary since it does not change the type of the expression
107        cy.getEntityDetailsHeading('topic');
108        cy.get(entityDetailsBackButtonSelector).click();
109        cy.wait('@entitiesRequest').then(({ response }) => {
110          expect(response!.statusCode).to.equal(200);111        });
112        cy.url().should('match', topicPageUrlPattern);
113      });
This assertion is unnecessary since it does not change the type of the expression
118        cy.get(entityCreateSaveButtonSelector).should('exist');
119        cy.get(entityCreateCancelButtonSelector).click();
120        cy.wait('@entitiesRequest').then(({ response }) => {
121          expect(response!.statusCode).to.equal(200);122        });
123        cy.url().should('match', topicPageUrlPattern);
124      });
This assertion is unnecessary since it does not change the type of the expression
 69        cy.get(entityCreateSaveButtonSelector).should('exist');
 70        cy.get(entityCreateCancelButtonSelector).click();
 71        cy.wait('@entitiesRequest').then(({ response }) => {
 72          expect(response!.statusCode).to.equal(200); 73        });
 74        cy.url().should('match', topicPageUrlPattern);
 75      });
This assertion is unnecessary since it does not change the type of the expression
 45    cy.visit('/');
 46    cy.clickOnEntityMenuItem('topic');
 47    cy.wait('@entitiesRequest').then(({ response }) => {
 48      if (response!.body.length === 0) { 49        cy.get(entityTableSelector).should('not.exist');
 50      } else {
 51        cy.get(entityTableSelector).should('exist');
This assertion is unnecessary since it does not change the type of the expression
128        cy.getEntityDeleteDialogHeading('topic').should('exist');
129        cy.get(entityConfirmDeleteButtonSelector).click();
130        cy.wait('@deleteEntityRequest').then(({ response }) => {
131          expect(response!.statusCode).to.equal(204);132        });
133        cy.wait('@entitiesRequest').then(({ response }) => {
134          expect(response!.statusCode).to.equal(200);