Skip to content

Commit

Permalink
feat: add step 1 check again
Browse files Browse the repository at this point in the history
  • Loading branch information
ngunner15 committed Oct 22, 2024
1 parent fd7b86d commit 923f43a
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,32 @@ describe('A Class Seedlot Registration form submission', () => {
cy.log('Step 5 complete');
}
});

// Step 1 check again
cy.get('ul.spar-seedlot-reg-progress-bar > li')
.eq(0)
.find(`.${prefix}--assistive-text`)
.then($element => {
const elementText = $element.text();
if (elementText === 'Incomplete') {
const url = `/seedlots/a-class-registration/${seedlotNum}/?step=1`;
cy.log('Step 1 incomplete');
cy.visit(url);

// Check the checkbox if unchecked
cy.get('#collection-step-default-checkbox')
.then($checkbox => {
if ($checkbox.is(':not(:checked)')) {
cy.get('#collection-step-default-checkbox').check({ force: true });
// Save changes
cy.saveSeedlotRegFormProgress();
}
})
.should("be.checked");
} else {
cy.log('Step 1 complete');
}
});
});

it('Popup title and subtitles', () => {
Expand Down

0 comments on commit 923f43a

Please sign in to comment.