labeling admin users and jest test

This commit is contained in:
Beverly Nguyen
2025-08-19 14:16:19 -07:00
parent 728038f161
commit 1740c57f08
3 changed files with 32 additions and 2 deletions

View File

@@ -87,7 +87,7 @@
{% if current_service.all_template_folders %}
<p class="usa-body tick-cross-list-hint">
{% if user.platform_admin %}
Platform admin - sees all folders
Platform admin can see all folders
{% else %}
{% set folder_count = user.template_folders_for_service(current_service) | length %}
{% if folder_count == 0 %}

View File

@@ -28,7 +28,7 @@
{% if current_user.has_permissions(ServicePermission.MANAGE_SERVICE) and form.users_with_permission.all_service_users %}
{{ form.users_with_permission }}
{% if form.platform_admins is defined and form.platform_admins %}
<p class="usa-hint">Platform administrators can see all folders and cannot be removed from folders:</p>
<p class="usa-hint">Platform admin can see all folders:</p>
<ul class="usa-hint usa-list">
{% for admin in form.platform_admins %}
<li>{{ admin.name }}</li>

View File

@@ -429,6 +429,36 @@ describe('Collapsible fieldset', () => {
expect(toggleButton.parentElement.style.display).toEqual('none');
});
test("clicking 'Select all' does not collapse the fieldset", () => {
const toggleButton = document.querySelector('.usa-button--small');
const doneButton = formGroup.querySelector('.selection-footer__button');
expect(helpers.element(fieldset).is('hidden')).toBe(false);
expect(doneButton.getAttribute('aria-expanded')).toEqual('true');
helpers.triggerEvent(toggleButton, 'click');
expect(helpers.element(fieldset).is('hidden')).toBe(false);
expect(doneButton.getAttribute('aria-expanded')).toEqual('true');
expect(doneButton.textContent.trim()).toEqual("Done choosing folders");
});
test("clicking 'Deselect all' does not collapse the fieldset", () => {
const toggleButton = document.querySelector('.usa-button--small');
const doneButton = formGroup.querySelector('.selection-footer__button');
helpers.triggerEvent(toggleButton, 'click');
expect(helpers.element(fieldset).is('hidden')).toBe(false);
expect(doneButton.getAttribute('aria-expanded')).toEqual('true');
helpers.triggerEvent(toggleButton, 'click');
expect(helpers.element(fieldset).is('hidden')).toBe(false);
expect(doneButton.getAttribute('aria-expanded')).toEqual('true');
expect(doneButton.textContent.trim()).toEqual("Done choosing folders");
});
});
describe("toggle button visibility on re-expansion", () => {