svelte-select icon indicating copy to clipboard operation
svelte-select copied to clipboard

simple example with @testing-library/svelte

Open pricetula opened this issue 8 months ago • 1 comments

Fantastic package however, I seem to have hit a snug trying to set focus and find available options.

// select-component.svelte

<Select
  options={[
    { value: 'val-1', label: 'label 1'},
    { value: 'val-2', label: 'label 2'}
  ]}
  placeholder="placeholder text"
/>

//select-component.test.ts

const selectInput = getByPlaceholderText('placeholder text');
expect(selectInput).toBeTruthy(); // passed
await fireEvent.focus(selectInput);
expect(getByText('label 1')).toBeTruthy(); // failed

Would be great to have a small example on how to test

pricetula avatar Nov 12 '23 11:11 pricetula