mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-26 13:35:16 +03:00
11 lines
314 B
JavaScript
11 lines
314 B
JavaScript
|
import {find, triggerEvent} from '@ember/test-helpers';
|
||
|
|
||
|
export async function submitForm(elementOrSelector) {
|
||
|
if (typeof elementOrSelector === 'string') {
|
||
|
elementOrSelector = find(elementOrSelector);
|
||
|
}
|
||
|
|
||
|
const form = elementOrSelector.closest('form');
|
||
|
await triggerEvent(form, 'submit');
|
||
|
}
|