diff --git a/src/renderer/src/components/native-chat/NativeChatPromptEditor.test.tsx b/src/renderer/src/components/native-chat/NativeChatPromptEditor.test.tsx index 78d8da92530..bb5e1d9ede6 100644 --- a/src/renderer/src/components/native-chat/NativeChatPromptEditor.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatPromptEditor.test.tsx @@ -31,9 +31,9 @@ function setup(value = '') { } describe('native chat skill editor', () => { - it('renders only picker insertions as pills and serializes the exact invocation', () => { + it('renders only picker insertions as pills and serializes the exact invocation', async () => { const { input, container } = setup('Please $rev') - act(() => input.insertSkill!(7, 11, '$review')) + await act(async () => input.insertSkill!(7, 11, '$review')) const pill = container.querySelector('[data-native-chat-skill]') expect(pill?.textContent).toBe('Review') expect(pill?.classList.contains('text-xs')).toBe(true) @@ -56,7 +56,7 @@ describe('native chat skill editor', () => { expect(container.querySelector('[data-native-chat-skill]')).toBeNull() }) - it('deletes a skill atomically and restores it with undo', () => { + it('deletes a skill atomically and restores it with undo', async () => { const { input, editor, container } = setup('$rev') act(() => input.insertSkill!(0, 4, '$review')) act(() => { @@ -65,20 +65,20 @@ describe('native chat skill editor', () => { }) expect(input.value).toBe(' ') expect(container.querySelector('[data-native-chat-skill]')).toBeNull() - act(() => { + await act(async () => { editor.commands.undo() }) expect(input.value).toBe('$review ') expect(container.querySelector('[data-native-chat-skill]')).not.toBeNull() }) - it('preserves multiple selected skills through multiline edits and clears them on send', () => { + it('preserves multiple selected skills through multiline edits and clears them on send', async () => { const { input, container } = setup('$one') act(() => input.insertSkill!(0, 4, '$one')) act(() => { input.value += '\nthen $two' }) - act(() => input.insertSkill!(11, 15, '$two')) + await act(async () => input.insertSkill!(11, 15, '$two')) expect(input.value).toBe('$one \nthen $two ') expect(container.querySelectorAll('[data-native-chat-skill]')).toHaveLength(2) act(() => {