open-vault/ui/tests/helpers/with-flash.js

14 lines
334 B
JavaScript
Raw Normal View History

import { create } from 'ember-cli-page-object';
import flashMessage from 'vault/tests/pages/components/flash-message';
const flash = create(flashMessage);
export default async function withFlash(promise, assertion) {
await flash.waitForFlash();
if (assertion) {
assertion();
}
await flash.clickAll();
await promise;
}