Skip to content

Commit 7ab40b6

Browse files
committed
test(tables): preserve editor timezone during edits
1 parent e2e09a3 commit 7ab40b6

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/cells/inline-editors.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,14 @@ describe('dateEditorRawValue', () => {
9191
})
9292
act(() => root.render(createElement(InlineEditor, props)))
9393

94-
const input = container.querySelector('input')
94+
const input = container.querySelector('input') as HTMLInputElement
9595
expect(input?.value).toBe('06/15/2026 6:00:30 AM')
96+
act(() => changeInput(input, '09/01/2026 9:00 AM'))
9697
act(() => {
97-
input?.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', bubbles: true }))
98+
input.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', bubbles: true }))
9899
})
99100

100-
expect(onSave).toHaveBeenCalledWith(value, 'enter')
101+
expect(onSave).toHaveBeenCalledWith(Date.parse('2026-09-01T16:00:00Z') / 1000, 'enter')
101102
act(() => root.unmount())
102103
container.remove()
103104
})

0 commit comments

Comments
 (0)