本文整理汇总了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);
});