Skip to content

Commit 496c5da

Browse files
committed
test: clarify selection logic for components in collection
1 parent b6908d1 commit 496c5da

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/library-authoring/component-picker/ComponentPicker.test.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ describe('<ComponentPicker />', () => {
230230
onChange.mockClear();
231231

232232
// Select another component
233+
/**
234+
* Due to collections have "Select" buttons as well, we need to target the 8th button in the list
235+
* to select the second component in the search results, taking into account the `library-search.json` mock data.
236+
*/
233237
fireEvent.click(screen.queryAllByRole('button', { name: 'Select' })[7]);
234238
await waitFor(() => expect(onChange).toHaveBeenCalledWith([
235239
{

0 commit comments

Comments
 (0)