Skip to content

Commit 38650b2

Browse files
committed
jest test for ColorPickerInput noValueText prop
1 parent c7d2d8c commit 38650b2

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

packages/components/src/internal/components/forms/input/ColorPickerInput.test.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ describe('ColorPickerInput', () => {
2020
expect(container).toMatchSnapshot();
2121
});
2222

23+
test('with noValueText', () => {
24+
const { container } = render(<ColorPickerInput value={undefined} noValueText="Auto" onChange={jest.fn} />);
25+
expect(container).toMatchSnapshot();
26+
});
27+
2328
test('showPicker', async () => {
2429
const { container } = render(<ColorPickerInput value="#000000" onChange={jest.fn} />);
2530
await userEvent.click(document.querySelector('.color-picker__button'));

packages/components/src/internal/components/forms/input/__snapshots__/ColorPickerInput.test.tsx.snap

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,27 @@ exports[`ColorPickerInput with button text 1`] = `
890890
</div>
891891
`;
892892

893+
exports[`ColorPickerInput with noValueText 1`] = `
894+
<div>
895+
<div
896+
class="color-picker"
897+
>
898+
<button
899+
class="color-picker__button btn btn-default"
900+
type="button"
901+
>
902+
Auto
903+
<i
904+
class="fa fa-caret-down"
905+
/>
906+
</button>
907+
<div
908+
class="color-picker__picker"
909+
/>
910+
</div>
911+
</div>
912+
`;
913+
893914
exports[`ColorPickerInput without value 1`] = `
894915
<div>
895916
<div

0 commit comments

Comments
 (0)