Skip to content

Commit

Permalink
DNM: VACMS-13188 Set Beneficiaries to Unlimited Cardinality (#16245)
Browse files Browse the repository at this point in the history
* VACMS-13188: Changes cardinality to unlimited for field_audience_beneficiares.

* VACMS-13188: Stubs out new cypress test for R&S content type.

* VACMS-13188: Adds checkbox commands to cypress.

* VACMS-13188: Updates R&S detail page test with tags validation.

---------

Co-authored-by: Daniel Sasser <[email protected]>
Co-authored-by: Jill Adams <[email protected]>
  • Loading branch information
3 people authored Dec 12, 2023
1 parent 74246a5 commit cbd6682
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ settings:
target_type: taxonomy_term
module: core
locked: false
cardinality: 1
cardinality: -1
translatable: true
indexes: { }
persist_with_no_fields: false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@content_type__support_resources_detail_page
Feature: Content Type: Resources and Support Detail Page

Scenario: Validate Tags with attention to conditional fields
Given I am logged in as a user with the "content_admin" role
When I am at "node/add/support_resources_detail_page"
Then I should see "Tags"

Given I select option "- None -" from dropdown "Audience"
Then I should not see an element with the selector "#edit-field-tags-0-subform-field-audience-beneficiares-wrapper"
And I should not see an element with the selector "#edit-field-tags-0-subform-field-non-beneficiares-wrapper"

Given I select option "Beneficiaries" from dropdown "Audience"
When I check all checkboxes within "#edit-field-tags-0-subform-field-audience-beneficiares"
Then I should see an element with the selector "#edit-field-tags-0-subform-field-audience-beneficiares-wrapper"
And I should not see an element with the selector "#edit-field-tags-0-subform-field-non-beneficiares-wrapper"

Given I select option "Non-beneficiaries" from dropdown "Audience"
Then I should not see an element with the selector "#edit-field-tags-0-subform-field-audience-beneficiares-wrapper"
And I should see an element with the selector "#edit-field-tags-0-subform-field-non-beneficiares-wrapper"

Given I check all checkboxes within "#edit-field-tags-0-subform-field-topics--wrapper"
Then an element with the selector "#edit-field-tags-0-subform-field-audience-selection" should be disabled

Given I uncheck the first checkbox within "#edit-field-tags-0-subform-field-topics--wrapper"
Then an element with the selector "#edit-field-tags-0-subform-field-audience-selection" should not be disabled
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,19 @@ Given(`I check the checkbox with selector {string}`, (selector) => {
Given(`I uncheck the checkbox with selector {string}`, (selector) => {
cy.get(selector).uncheck({ force: true });
});

Given(`I check all checkboxes within {string}`, (selector) => {
cy.get(selector).find('input[type="checkbox"]').as("checkboxes").check();

cy.get("@checkboxes").each((checkbox) => {
expect(checkbox[0].checked).to.equal(true);
});
});

Given(`I check the first checkbox within {string}`, (selector) => {
cy.get(selector).find('input[type="checkbox"]').first().check();
});

Given(`I uncheck the first checkbox within {string}`, (selector) => {
cy.get(selector).find('input[type="checkbox"]').first().uncheck();
});

0 comments on commit cbd6682

Please sign in to comment.