fix assertNoToasts

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2020-05-27 14:35:59 +01:00
parent 61066b0c4c
commit 91811581bc
1 changed files with 6 additions and 2 deletions

View File

@ -17,8 +17,12 @@ limitations under the License.
const assert = require('assert');
async function assertNoToasts(session) {
const toast = await session.query('.mx_Toast_toast');
assert(!toast, 'toast found when none expected');
try {
await session.query('.mx_Toast_toast');
} catch (e) {
return;
}
throw new Error('toast found when none expected');
}
async function assertToast(session, expectedTitle) {