mirror of
https://git.shipoclu.com/moon/plspace.git
synced 2026-08-13 02:42:30 +00:00
public profile editing
This commit is contained in:
@@ -79,4 +79,27 @@ describe('Composer', () => {
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
it.each([
|
||||
['Command+Enter', { metaKey: true }],
|
||||
['Ctrl+Enter', { ctrlKey: true }],
|
||||
])('submits with %s from the focused compose field', async (_label, modifier) => {
|
||||
const postStatus = vi.fn().mockResolvedValue(status())
|
||||
const services = testServices({
|
||||
session: session({ token: 'token', me: account(), signedIn: true }),
|
||||
endpoints: { postStatus },
|
||||
})
|
||||
const view = render(Composer, {
|
||||
props: { initialText: 'Keyboard-posted entry' },
|
||||
context: new Map([[APP_SERVICES, services]]),
|
||||
})
|
||||
|
||||
await fireEvent.keyDown(view.getByRole('textbox', { name: 'Entry text' }), {
|
||||
key: 'Enter',
|
||||
...modifier,
|
||||
})
|
||||
|
||||
await waitFor(() => expect(postStatus).toHaveBeenCalledOnce())
|
||||
expect(postStatus.mock.calls[0][1].status).toBe('Keyboard-posted entry')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user