From df1d223601f5a08d42c97d497918f81467030951 Mon Sep 17 00:00:00 2001 From: Steve Wirt Date: Tue, 9 Jan 2024 22:44:19 -0500 Subject: [PATCH] VACMS-16146 Verify that disabled VBA banner data does not persist. --- .../facilities/vba/vba_facility.feature | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/tests/cypress/integration/features/content_type/facilities/vba/vba_facility.feature b/tests/cypress/integration/features/content_type/facilities/vba/vba_facility.feature index be6831e70c..375e546b2f 100644 --- a/tests/cypress/integration/features/content_type/facilities/vba/vba_facility.feature +++ b/tests/cypress/integration/features/content_type/facilities/vba/vba_facility.feature @@ -6,20 +6,42 @@ Feature: CMS User may effectively interact with the VBA Facility form Scenario: Log in and try to edit an archived VBA Facility as a VBA editor When I am logged in as a user with the roles "content_creator_vba, content_publisher" + # Columbia VA Regional Benefit Office And my workbench access sections are set to "1065" + # Fort Jackson Satelite office - an archived facility in that section. Then I am at "/node/4071/" Then the primary tab "View" should exist Then the primary tab "Edit" should not exist - Scenerio: Enable banner segment and ensure expected fields are present + Scenario: Enable banner segment and ensure expected fields are present Given I am logged in as a user with the "content_admin" role - When I am at "node/add/vba_facility" + And my workbench access sections are set to "1065" + # Columbia VA Regional Benefit Office + When I am at "/node/4063/edit" + # Banner related fields should not be visible. + And I scroll to element '#edit-field-show-banner-value' + And I uncheck the "Display a banner alert on this facility" checkbox Then I should not see an element with the selector "#edit-field-alert-type" And I should not see an element with the selector "#edit-field-dismissible-option--wrapper" And I should not see an element with the selector "#edit-field-banner-title-0-value" And I should not see an element with the selector "#edit-field-banner-content-wrapper" - When I click to "Display a banner alert on this facility" - Then I should not see an element with the selector "#edit-field-alert-type" + When I check the "Display a banner alert on this facility" checkbox + # Banner related fields should be visible. + Then I should see an element with the selector "#edit-field-alert-type" And I should see an element with the selector "#edit-field-dismissible-option--wrapper" And I should see an element with the selector "#edit-field-banner-title-0-value" - And I should not see an element with the selector "#edit-field-banner-content-wrapper" + And I should see an element with the selector "#edit-field-banner-content-wrapper" + # Banner field data should not persist if it is disabled. + When I select option "Information" from dropdown "Banner alert type" + And I select the "Allow site visitors to dismiss banner" radio button + And I fill in field with selector "#edit-field-banner-title-0-value" with value "[Test Data] Test banner title." + And I fill in ckeditor "edit-field-banner-content-0-value" with "[Test Data] Banner Body" + And I fill in field with selector "#edit-revision-log-0-value" with value "[Test Data] Revision log message." + And I uncheck the "Display a banner alert on this facility" checkbox + And I save the node + Then I should see "VBA Facility Columbia VA Regional Benefit Office has been updated." + When I am at "/node/4063/edit" + And I scroll to element '#edit-field-show-banner-value' + And I check the "Display a banner alert on this facility" checkbox + Then an element with the selector "#edit-field-banner-title-0-value" should be empty + And the option "- Select a value -" from dropdown with selector "#edit-field-alert-type" should be selected