Add a hint when no team members are selected

This helps clarify that you will still be able to see the folder.
Follows the phrasing used for the "No folders…" message.
This commit is contained in:
Chris Hill-Scott
2019-05-09 13:33:33 +01:00
parent 1ffa8c8915
commit 923ac7190c
2 changed files with 26 additions and 9 deletions

View File

@@ -205,7 +205,7 @@ describe('Collapsible fieldset', () => {
});
test("the summary doesn't have a folder icon if fields aren't called 'folder'", () => {
formGroup.dataset.fieldLabel = 'team member';
// start module
@@ -361,7 +361,27 @@ describe('Collapsible fieldset', () => {
// click the first checkbox
helpers.triggerEvent(checkboxes[0], 'click');
expect(summaryText.textContent).toEqual("No team members");
expect(summaryText.textContent).toEqual("No team members (only you)");
});
test("if fields are called 'arbitrary thing'", () => {
formGroup.dataset.fieldLabel = 'arbitrary thing';
checkFirstCheckbox();
// start module
window.GOVUK.modules.start();
showCheckboxes();
const summaryText = document.querySelector('.selection-summary__text');
// click the first checkbox
helpers.triggerEvent(checkboxes[0], 'click');
expect(summaryText.textContent).toEqual("No arbitrary things");
});