fix assertNoToasts

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-05-27 14:35:59 +01:00
parent 61066b0c4c
commit 91811581bc

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) {