From 330eb61148389ba58eff5811321a9d717795d2bb Mon Sep 17 00:00:00 2001 From: Jack Fragassi Date: Wed, 15 Nov 2023 12:57:06 -0800 Subject: [PATCH] Add fix for AsyncSelect --- .../src/components/Select/AsyncSelect.test.tsx | 14 ++++++++++++++ .../src/components/Select/AsyncSelect.tsx | 1 + 2 files changed, 15 insertions(+) diff --git a/superset-frontend/src/components/Select/AsyncSelect.test.tsx b/superset-frontend/src/components/Select/AsyncSelect.test.tsx index c1442a6b70a1c..0bb24b474a0cc 100644 --- a/superset-frontend/src/components/Select/AsyncSelect.test.tsx +++ b/superset-frontend/src/components/Select/AsyncSelect.test.tsx @@ -868,6 +868,20 @@ test('fires onChange when clearing the selection in multiple mode', async () => expect(onChange).toHaveBeenCalledTimes(1); }); +test('fires onChange when pasting a selection', async () => { + const onChange = jest.fn(); + render(); + await open(); + const input = getElementByClassName('.ant-select-selection-search-input'); + const paste = createEvent.paste(input, { + clipboardData: { + getData: () => OPTIONS[0].label, + }, + }); + fireEvent(input, paste); + expect(onChange).toHaveBeenCalledTimes(1); +}); + test('does not duplicate options when using numeric values', async () => { render(