Fixed date picker UI that was too overloaded (#5039)
Date picker UI was off because of the recent refactor with new field types Date and DateTime. We had to allow the date picker to edit both. In this PR we come back to the previous design and we only use the input to modify time. Also we use our Select component instead of the ones from the library `react-datepicker` --------- Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
@ -126,9 +126,9 @@ type Story = StoryObj<typeof DateFieldInputWithContext>;
|
||||
export const Default: Story = {
|
||||
play: async ({ canvasElement }) => {
|
||||
const canvas = within(canvasElement);
|
||||
const div = await canvas.findByText('February - 2022');
|
||||
const div = await canvas.findByText('February');
|
||||
|
||||
await expect(div.innerText).toContain('February - 2022');
|
||||
await expect(div.innerText).toContain('February');
|
||||
},
|
||||
};
|
||||
|
||||
@ -138,7 +138,7 @@ export const ClickOutside: Story = {
|
||||
|
||||
await expect(clickOutsideJestFn).toHaveBeenCalledTimes(0);
|
||||
|
||||
await canvas.findByText('February - 2022');
|
||||
await canvas.findByText('February');
|
||||
const emptyDiv = canvas.getByTestId('data-field-input-click-outside-div');
|
||||
await userEvent.click(emptyDiv);
|
||||
|
||||
@ -151,7 +151,7 @@ export const Escape: Story = {
|
||||
await expect(escapeJestFn).toHaveBeenCalledTimes(0);
|
||||
const canvas = within(canvasElement);
|
||||
|
||||
await canvas.findByText('February - 2022');
|
||||
await canvas.findByText('February');
|
||||
await userEvent.keyboard('{escape}');
|
||||
|
||||
await expect(escapeJestFn).toHaveBeenCalledTimes(1);
|
||||
@ -163,7 +163,7 @@ export const Enter: Story = {
|
||||
await expect(enterJestFn).toHaveBeenCalledTimes(0);
|
||||
const canvas = within(canvasElement);
|
||||
|
||||
await canvas.findByText('February - 2022');
|
||||
await canvas.findByText('February');
|
||||
await userEvent.keyboard('{enter}');
|
||||
|
||||
await expect(enterJestFn).toHaveBeenCalledTimes(1);
|
||||
|
||||
Reference in New Issue
Block a user