Skip to content

Commit 05ea56d

Browse files
committed
Update tests
1 parent 3aacfc7 commit 05ea56d

File tree

1 file changed

+11
-7
lines changed
  • src/components/interactive-builder/modals/question/question-form/rendering-types/inputs/select

1 file changed

+11
-7
lines changed

src/components/interactive-builder/modals/question/question-form/rendering-types/inputs/select/select-answers.test.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe('Select answers component', () => {
6868
).toBeInTheDocument();
6969
});
7070

71-
it('lets user select answers provided by concept', async () => {
71+
it('shows answers provided by concept as selected initially', async () => {
7272
const user = userEvent.setup();
7373
renderComponent();
7474
const answersMenu = screen.getByRole('combobox', {
@@ -77,16 +77,20 @@ describe('Select answers component', () => {
7777
expect(answersMenu).toBeInTheDocument();
7878

7979
await user.click(answersMenu);
80-
const answerOption1 = screen.getByRole('option', { name: /answer 1/i });
80+
const answerOption1 = screen.getByRole('checkbox', {
81+
name: /answer 1/i,
82+
});
8183
expect(answerOption1).toBeInTheDocument();
82-
expect(screen.getByText(/answer 2/i)).toBeInTheDocument();
83-
await user.click(answerOption1);
84+
expect(
85+
screen.getByRole('checkbox', {
86+
name: /answer 2/i,
87+
}),
88+
).toBeInTheDocument();
8489

8590
expect(screen.getByTitle(/answer 1/i)).toBeInTheDocument();
91+
expect(screen.getByTitle(/answer 2/i)).toBeInTheDocument();
8692
expect(
87-
screen.getByRole('combobox', {
88-
name: /select answers to display/i,
89-
}),
93+
screen.getByText(/total items selected: 2 answer 1answer 2,to clear selection, press delete or backspace/i),
9094
).toBeInTheDocument();
9195
});
9296

0 commit comments

Comments
 (0)