From f1e72c167c72926a038e810206914879ac13e79f Mon Sep 17 00:00:00 2001 From: Paul Mineev Date: Mon, 12 Sep 2022 18:15:28 -0700 Subject: [PATCH] fix selected item --- .../remark42/app/components/select/select.spec.tsx | 12 ++++-------- .../apps/remark42/app/components/select/select.tsx | 5 +---- .../remark42/app/components/sort-picker.spec.tsx | 3 +-- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/frontend/apps/remark42/app/components/select/select.spec.tsx b/frontend/apps/remark42/app/components/select/select.spec.tsx index 9b5f9f2b01..229c88ae56 100644 --- a/frontend/apps/remark42/app/components/select/select.spec.tsx +++ b/frontend/apps/remark42/app/components/select/select.spec.tsx @@ -21,15 +21,11 @@ describe('); - - const selectedItem = items[0]; - const selectedOption = screen.getAllByRole('option')[0]; + const selectedIndex = 1; + const selectedItem = items[selectedIndex]; - expect(screen.getAllByText(selectedItem.label)).toHaveLength(2); - expect(selectedOption).toBeInTheDocument(); - expect(selectedOption.selected).toBeTruthy(); - expect(selectedOption.textContent).toBe(selectedItem.label); + render(