Skip to content

Commit

Permalink
feat: 1361 add cancel button at seedlot review page (#1452)
Browse files Browse the repository at this point in the history
  • Loading branch information
craigyu authored Aug 1, 2024
1 parent a4997e1 commit c425394
Show file tree
Hide file tree
Showing 81 changed files with 1,596 additions and 1,270 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ public ResponseEntity<Void> updateSeedlotStatus(
@Parameter(
name = "status",
in = ParameterIn.PATH,
description = "Seedlot status to be updated to",
description = "Seedlot status to be updated to, either PND or APP",
required = true,
example = "true",
example = "PND",
schema = @Schema(type = "string", example = "true"))
@PathVariable
String status) {
tscAdminService.updateSeedlotStatus(seedlotNumber, status);
tscAdminService.updateSeedlotStatus(seedlotNumber, status.toUpperCase());
return ResponseEntity.noContent().build();
}

Expand Down
1 change: 1 addition & 0 deletions frontend/cypress/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const TWO_SECONDS = 2 * ONE_SECOND;
export const THREE_SECONDS = 3 * ONE_SECOND;
export const FIVE_SECONDS = 5 * ONE_SECOND;
export const TEN_SECONDS = 10 * ONE_SECOND;
export const TWENTY_SECONDS = 2 * TEN_SECONDS;
export const TYPE_DELAY = 50;

export const INVALID_EMAIL = 'test.com.br';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@ describe('A Class Seedlot Registration form, Collection and Interim storage', ()

cy.get('.seedlot-registration-title')
.find('h1')
.should('have.text', 'Seedlot Registration');

cy.get('.seedlot-registration-title')
.find('.seedlot-form-subtitle')
.should('contain.text', `Seedlot ${seedlotNum}`);
.should('have.text', `Registration for seedlot ${seedlotNum}`);

cy.get('.collection-step-row')
.find('h2')
Expand Down Expand Up @@ -120,7 +116,8 @@ describe('A Class Seedlot Registration form, Collection and Interim storage', ()
.type(testAcronym)
.blur();

cy.get(`svg.${prefix}--inline-loading__checkmark-container`)
cy.get('#collection-collector-agency-loading-status-tooltip')
.find(`svg.${prefix}--inline-loading__checkmark-container`)
.should('be.visible');

// Enter invalid location code
Expand All @@ -135,7 +132,7 @@ describe('A Class Seedlot Registration form, Collection and Interim storage', ()
// Enter valid location code
cy.get('#collection-location-code')
.clear()
.type('02')
.type('03')
.blur();

// Save changes
Expand Down Expand Up @@ -191,7 +188,7 @@ describe('A Class Seedlot Registration form, Collection and Interim storage', ()
// Enter location code for linkage test
cy.get('#collection-location-code')
.clear()
.type('02')
.type('03')
.blur();

// Save changes
Expand Down Expand Up @@ -325,10 +322,9 @@ describe('A Class Seedlot Registration form, Collection and Interim storage', ()
.contains('Next')
.click();

// Check svg with complete checkmark on Step 1
cy.get('ul.spar-seedlot-reg-progress-bar li')
.eq(0)
.should('have.class', `${prefix}--progress-step--complete`);
// Check step complete status
cy.get(`.${prefix}--progress-step--complete`)
.contains('Collection');
});

// Step 3
Expand All @@ -354,7 +350,7 @@ describe('A Class Seedlot Registration form, Collection and Interim storage', ()
.should('have.value', testPopupAcronym);

cy.get('#interim-location-code')
.should('have.value', '02');
.should('have.value', '03');

cy.get('#interim-use-collection-agency')
.should('be.checked');
Expand Down Expand Up @@ -398,7 +394,8 @@ describe('A Class Seedlot Registration form, Collection and Interim storage', ()
.type('01')
.blur();

cy.get(`svg.${prefix}--inline-loading__checkmark-container`)
cy.get('#interim-location-code-loading-status-tooltip')
.find(`svg.${prefix}--inline-loading__checkmark-container`)
.should('be.visible');

// Save changes
Expand Down Expand Up @@ -518,9 +515,8 @@ describe('A Class Seedlot Registration form, Collection and Interim storage', ()
.contains('Next')
.click();

// Check svg with complete checkmark on Step 3
cy.get('ul.spar-seedlot-reg-progress-bar li')
.eq(2)
.should('have.class', `${prefix}--progress-step--complete`);
// Check step complete status
cy.get(`.${prefix}--progress-step--complete`)
.contains('Interim storage');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ describe('A Class Seedlot Registration form, Extraction and Storage', () => {
});

it('Page title and subtitles', () => {
cy.get('.seedlot-registration-title')
.find('h1')
.should('have.text', `Registration for seedlot ${seedlotNum}`);

cy.get('.extraction-information-title')
.find('h2')
.should('have.text', regFormData.extraction.extrationTitle);
Expand Down Expand Up @@ -88,32 +92,33 @@ describe('A Class Seedlot Registration form, Extraction and Storage', () => {
.uncheck({ force: true });

// Enter invalid acronym
cy.get('#ext-agency-combobox')
cy.get('#ext-agency-number')
.type('ggg')
.blur();

cy.get('#ext-agency-combobox-error-msg')
cy.get('#ext-agency-number-error-msg')
.should('have.text', regFormData.extraction.agencyErrorMsg);

// Enter invalid acronym
cy.get('#ext-agency-combobox')
cy.get('#ext-agency-number')
.clear()
.type('-1')
.blur();

cy.get('#ext-agency-combobox-error-msg')
cy.get('#ext-agency-number-error-msg')
.should('have.text', regFormData.extraction.agencyValidationMsg);

cy.get('.applicant-error-notification')
.should('be.visible');

// Enter valid test acronym
cy.get('#ext-agency-combobox')
cy.get('#ext-agency-number')
.clear()
.type(testAcronym)
.blur();

cy.get(`svg.${prefix}--inline-loading__checkmark-container`)
cy.get('#ext-agency-number-loading-status-tooltip')
.find(`svg.${prefix}--inline-loading__checkmark-container`)
.should('be.visible');

cy.get('.applicant-error-notification')
Expand All @@ -134,6 +139,10 @@ describe('A Class Seedlot Registration form, Extraction and Storage', () => {
.type('00')
.blur();

cy.get('#ext-location-code-loading-status-tooltip')
.find(`svg.${prefix}--inline-loading__checkmark-container`)
.should('be.visible');

// Save changes
cy.saveSeedlotRegFormProgress();
});
Expand Down Expand Up @@ -182,7 +191,7 @@ describe('A Class Seedlot Registration form, Extraction and Storage', () => {
.contains('Apply selected client')
.click({ force: true });

cy.get('#ext-agency-combobox')
cy.get('#ext-agency-number')
.should('have.value', testPopupAcronym);

cy.get('#ext-location-code')
Expand Down Expand Up @@ -226,32 +235,33 @@ describe('A Class Seedlot Registration form, Extraction and Storage', () => {
.uncheck({ force: true });

// Enter invalid acronym
cy.get('#str-agency-combobox')
cy.get('#str-agency-number')
.type('ggg')
.blur();

cy.get('#str-agency-combobox-error-msg')
cy.get('#str-agency-number-error-msg')
.should('have.text', regFormData.extraction.agencyErrorMsg);

// Enter invalid acronym
cy.get('#str-agency-combobox')
cy.get('#str-agency-number')
.clear()
.type('-1')
.blur();

cy.get('#str-agency-combobox-error-msg')
cy.get('#str-agency-number-error-msg')
.should('have.text', regFormData.extraction.agencyValidationMsg);

cy.get('.applicant-error-notification')
.should('be.visible');

// Enter valid test acronym
cy.get('#str-agency-combobox')
cy.get('#str-agency-number')
.clear()
.type(testAcronym)
.blur();

cy.get(`svg.${prefix}--inline-loading__checkmark-container`)
cy.get('#str-agency-number-loading-status-tooltip')
.find(`svg.${prefix}--inline-loading__checkmark-container`)
.should('be.visible');

cy.get('.applicant-error-notification')
Expand All @@ -272,6 +282,10 @@ describe('A Class Seedlot Registration form, Extraction and Storage', () => {
.type('00')
.blur();

cy.get('#str-location-code-loading-status-tooltip')
.find(`svg.${prefix}--inline-loading__checkmark-container`)
.should('be.visible');

// Save changes
cy.saveSeedlotRegFormProgress();
});
Expand Down Expand Up @@ -319,7 +333,7 @@ describe('A Class Seedlot Registration form, Extraction and Storage', () => {
.contains('Apply selected client')
.click();

cy.get('#str-agency-combobox')
cy.get('#str-agency-number')
.should('have.value', testPopupAcronym);

cy.get('#str-location-code')
Expand Down
Loading

0 comments on commit c425394

Please sign in to comment.