Skip to content

Commit

Permalink
fix: checkbox logic code
Browse files Browse the repository at this point in the history
  • Loading branch information
ngunner15 committed Oct 1, 2024
1 parent 0dbb0d4 commit 8051c79
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,14 @@ describe('A Class Seedlot Registration form, Ownership', () => {
.find('p')
.should('have.text', regFormData.ownership.subtitle);

// Check the checkbox if unchecked
cy.get('#default-owner-checkbox')
.then($checkbox => {
if ($checkbox.is(':checked')) {
cy.wrap($checkbox).should("be.checked", { force: true }) // passes if checked
if ($checkbox.is(':not(:checked)')) {
cy.get('#default-owner-checkbox').check({ force: true });
}
else {
cy.wrap($checkbox).click()
cy.wrap($checkbox).should("be.checked", { force: true }) // passes if not checked
}
});
})
.should("be.checked");

cy.get(`.${prefix}--accordion__title`)
.find('.item-title-section')
Expand Down

0 comments on commit 8051c79

Please sign in to comment.