From 5fcf0e05f7e777f3a62e501d916d9ef66f31368e Mon Sep 17 00:00:00 2001 From: Eric Bonow Date: Sun, 7 Mar 2021 19:23:56 -0600 Subject: [PATCH 1/2] Remove skip indicators from autoFocus tests --- .changeset/little-ants-sort.md | 5 ++++ .../react-select/src/__tests__/Select.test.js | 29 +++++++------------ 2 files changed, 16 insertions(+), 18 deletions(-) create mode 100644 .changeset/little-ants-sort.md diff --git a/.changeset/little-ants-sort.md b/.changeset/little-ants-sort.md new file mode 100644 index 0000000000..6cc0209cdf --- /dev/null +++ b/.changeset/little-ants-sort.md @@ -0,0 +1,5 @@ +--- +'react-select': patch +--- + +Fixed 3 unit test test cases instead of skipping them diff --git a/packages/react-select/src/__tests__/Select.test.js b/packages/react-select/src/__tests__/Select.test.js index 4a3c9094af..09cf85211c 100644 --- a/packages/react-select/src/__tests__/Select.test.js +++ b/packages/react-select/src/__tests__/Select.test.js @@ -2040,10 +2040,6 @@ cases( } ); -/** - * onFocus hook is not being called when component is mounted is autoFocus true - * Reproducible here -> https://codesandbox.io/s/71xrkj0qj - */ cases( 'onFocus prop with autoFocus', ({ props = { ...BASIC_PROPS, autoFocus: true } }) => { @@ -2056,10 +2052,12 @@ cases( }, { 'single select > should call auto focus only once when select is autoFocus': { - skip: true, + props: { + ...BASIC_PROPS, + autoFocus: true, + }, }, 'multi select > should call auto focus only once when select is autoFocus': { - skip: true, props: { ...BASIC_PROPS, autoFocus: true, @@ -2732,18 +2730,13 @@ test('to clear value when hitting escape if escapeClearsValue and isClearable ar }); }); -/** - * Selects the option on hitting spacebar on V2 - * Needs varification - */ -test.skip('hitting spacebar should not select option if isSearchable is true (default)', () => { - // let onChangeSpy = jest.fn(); - // let props = { ...BASIC_PROPS, onChange: onChangeSpy }; - // let { container } = render(); + // Open Menu + fireEvent.keyDown(container, { keyCode: 32, key: ' ' }); + expect(onChangeSpy).not.toHaveBeenCalled(); }); test('renders with custom theme', () => { From 8cae77fb37a8c154d02302306616f50d935bb076 Mon Sep 17 00:00:00 2001 From: Eric Bonow Date: Thu, 18 Mar 2021 21:44:28 -0500 Subject: [PATCH 2/2] Delete little-ants-sort.md Deleting changeset --- .changeset/little-ants-sort.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .changeset/little-ants-sort.md diff --git a/.changeset/little-ants-sort.md b/.changeset/little-ants-sort.md deleted file mode 100644 index 6cc0209cdf..0000000000 --- a/.changeset/little-ants-sort.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'react-select': patch ---- - -Fixed 3 unit test test cases instead of skipping them