Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('visiting /foo', async function(assert) {
await visit('/foo');
assert.equal(currentURL(), '/foo');
assert.ok(find('.foo'));
});
export async function login(assert, email = null, password = null, gotoLoginPage = true) {
if (gotoLoginPage) {
await visit('/login');
}
assert.equal(currentURL(), '/login');
await fillIn('input[name=email]', email !== null ? email : 'opev-fe@test.com');
await fillIn('input[name=password]', password !== null ? password : 'test-fe-user');
await click('button[type=submit]');
await settled();
}
test('visiting /bar', async function(assert) {
await visit('/bar');
assert.equal(currentURL(), '/bar');
});
return function() {
return regExp.test(currentURL());
};
};
test('visiting /foo', async function(assert) {
await visit('/foo');
await fillIn('#bar', 'baz');
await fillIn(this.element.querySelectorAll('#qux input')[5], 'qaaz');
assert.equal(currentURL(), '/foo');
});
test('routing helpers', async (assert) => {
await visit('/foo');
assert.equal(currentURL(), '/foo');
assert.equal(currentRouteName(), 'foo');
});
test('visiting /foo', async function(assert) {
await visit('/foo');
assert.equal(currentURL(), '/foo');
assert.equal(currentPath(), 'foo.index');
assert.equal(currentRouteName(), 'foo');
});
export async function logout(assert) {
await visit('/logout');
await settled();
assert.equal(currentURL(), '/');
assert.ok(currentSession().session.isAuthenticated !== true);
}
function currentURL(...args) {
return require('@ember/test-helpers').currentURL(...args);
}