本文整理匯總了TypeScript中@ember/test-helpers.currentURL函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript currentURL函數的具體用法?TypeScript currentURL怎麽用?TypeScript currentURL使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了currentURL函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test
test('page renders with default states', function(assert) {
assert.equal(currentURL(), '/chat/privately-with/me');
assert.notOk(chat.textarea.isDisabled(), 'textarea is enabled');
assert.ok(chat.submitButton.isDisabled(), 'submit button is disabled');
assert.equal(chat.messages.all().length, 0, 'history is blank');
});
示例2: refresh
export async function refresh(mocking: () => void = () => undefined) {
const url = currentURL();
const ctx = getContext();
await teardownContext(ctx);
await setupContext(ctx);
await mocking();
await visit(url);
}
示例3: test
test('Search does not through an error when typing', async function(assert) {
await appLogin();
await visit('/');
assert.equal(currentURL(), '/browse/datasets', 'We made it to the home page in one piece');
fillIn(searchBarSelector, 'Hello darkness my old friend');
assert.ok(true, 'Did not encounter an error when filling in search bar');
});
示例4: visit
@test async 'visiting /'(assert: Assert) {
await visit('/');
assert.equal(currentURL(), '/');
const codeElement: Element | null = find('.index-view code');
if (codeElement === null) { throw new Error('no <code>'); }
assert.ok(/min\-width:\s[0-9]+px/.test('' + codeElement.textContent), 'min-width text found');
}
示例5: visit
@test public async 'visiting /injection-factories'(assert: Assert) {
await visit('/injection-factories');
assert.equal(currentURL(), '/injection-factories', 'Test page loads');
const view = find('.mike-view');
assert.ok(view, '.mike-view found');
if (!view) { throw new Error(''); }
const viewId = view.id;
assert.ok(getViewById.call(this, viewId).get('resizeService'), 'resizeService has been injected onto views');
const component = find('.test-component');
assert.ok(component, '.test-component found');
if (!component) { throw new Error(''); }
const componentId = component.id;
// tslint:disable-next-line:max-line-length
assert.ok(getViewById.call(this, componentId).get('resizeService'), 'resizeService has been injected onto components');
}
示例6: test
test('a redirect to your own chat occurs', function(assert) {
assert.equal(currentURL(), '/chat/privately-with/me');
percySnapshot(assert as any);
});