Skip to content

Commit

Permalink
refactor(test): remove error prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Guribeiro committed Oct 2, 2024
1 parent 2f03ad8 commit 40a1feb
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ const items: Item[] = [

let value: string;
let placeholder: string;
let error: string;

describe('placeholder text', () => {
beforeEach(() => {
value = '';
placeholder = 'Select an item';
error = 'There is an error';
});

it('should be able to render placeholder when there is no item selected', async () => {
Expand All @@ -48,23 +46,5 @@ describe('error text', () => {
beforeEach(() => {
value = '';
placeholder = 'Select an item';
error = 'There is an error';
});

it('should be able to render error message', async () => {
const { getByTestId } = render(
<ModalSelect
items={items}
value={value}
error={error}
placeholder={placeholder}
onChange={(v) => console.log(v)}
/>
);

const errorText = getByTestId('text-error');

expect(errorText).toBeTruthy();
expect(errorText.props.children).toBe(error);
});
});

0 comments on commit 40a1feb

Please sign in to comment.