From 712c18efce5c45f34a0386cb7c133115cd18154e Mon Sep 17 00:00:00 2001 From: Shahzaib Date: Mon, 16 Aug 2021 21:03:33 +0500 Subject: [PATCH] [GH-858] Add test cases for the multi-select component (#906) * test(multiSelect): Add test cases for multi-select * Remove `creatable-selector-parent` test id * test(multiSelect): Make elements more accessible * Update all snapshots that renders the `multiSelect`, `iconButton`, and `textOption` components * Add the internationalized messages for the `aria-label` attributes * cleanup(multiSelect.test.tsx): Remove the `DndProvider` from the `Wrapper` component * Change the `ids` of `intl.formatMessage` arg Co-authored-by: Shahzaib --- webapp/i18n/en.json | 4 +- .../cardDetailContents.test.tsx.snap | 11 + .../cardDetailProperties.test.tsx.snap | 2 + .../globalHeaderSettingsMenu.test.tsx.snap | 36 +++ .../__snapshots__/multiSelect.test.tsx.snap | 22 ++ .../properties/multiSelect.test.tsx | 248 ++++++++++++++++++ .../src/components/properties/multiSelect.tsx | 3 +- .../sidebarSettingsMenu.test.tsx.snap | 52 ++++ .../table/__snapshots__/table.test.tsx.snap | 21 ++ .../tableGroupHeaderRow.test.tsx.snap | 16 ++ .../tableHeaderMenu.test.tsx.snap | 26 ++ .../__snapshots__/tableRow.test.tsx.snap | 4 + .../__snapshots__/propertyMenu.test.tsx.snap | 34 +++ webapp/src/widgets/buttons/iconButton.tsx | 2 + webapp/src/widgets/menu/colorOption.tsx | 4 + webapp/src/widgets/menu/textOption.tsx | 2 + webapp/src/widgets/valueSelector.tsx | 7 +- 17 files changed, 491 insertions(+), 3 deletions(-) create mode 100644 webapp/src/components/properties/__snapshots__/multiSelect.test.tsx.snap create mode 100644 webapp/src/components/properties/multiSelect.test.tsx diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json index 54421adfe..037b41e6a 100644 --- a/webapp/i18n/en.json +++ b/webapp/i18n/en.json @@ -7,7 +7,6 @@ "BoardComponent.no-property": "No {property}", "BoardComponent.no-property-title": "Items with an empty {property} property will go here. This column cannot be removed.", "BoardComponent.show": "Show", - "BoardPage.syncFailed": "Board may be deleted or access revoked.", "CardDetail.add-content": "Add content", "CardDetail.add-icon": "Add icon", "CardDetail.add-property": "+ Add a property", @@ -16,6 +15,7 @@ "CardDetail.new-comment-placeholder": "Add a comment...", "CardDialog.editing-template": "You're editing a template", "CardDialog.nocard": "This card doesn't exist or is inaccessible", + "ColorOption.selectColor": "Select {color} Color", "Comment.delete": "Delete", "CommentsList.send": "Send", "ContentBlock.Delete": "Delete", @@ -121,6 +121,8 @@ "TableHeaderMenu.sort-ascending": "Sort ascending", "TableHeaderMenu.sort-descending": "Sort descending", "TableRow.open": "Open", + "ValueSelector.valueSelector": "Value selector", + "ValueSelectorLabel.openMenu": "Open Menu", "View.AddView": "Add View", "View.Board": "Board", "View.DeleteView": "Delete View", diff --git a/webapp/src/components/cardDetail/__snapshots__/cardDetailContents.test.tsx.snap b/webapp/src/components/cardDetail/__snapshots__/cardDetailContents.test.tsx.snap index f142263c9..36a5ed818 100644 --- a/webapp/src/components/cardDetail/__snapshots__/cardDetailContents.test.tsx.snap +++ b/webapp/src/components/cardDetail/__snapshots__/cardDetailContents.test.tsx.snap @@ -168,6 +168,7 @@ exports[`components/cardDetail/cardDetailContents should match snapshot after dr >