本文整理汇总了TypeScript中@ember/test-helpers.visit函数的典型用法代码示例。如果您正苦于以下问题:TypeScript visit函数的具体用法?TypeScript visit怎么用?TypeScript visit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了visit函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: visit
export async function visit(url: string) {
try {
await dangerousVisit(url);
} catch (e) {
// console.error('visit wrapper around default visit helper', e);
}
}
示例2: function
hooks.beforeEach(async function() {
window.Notification = {
permission: undefined,
};
await visit('/chat/privately-with/me');
});
示例3: function
hooks.beforeEach(async function() {
const store = getService<StoreService>('store');
await store.createRecord('relay', defaultRelays[0]).save();
await store.createRecord('relay', defaultRelays[1]).save();
await store.createRecord('relay', defaultRelays[2]).save();
await visit(path);
});
示例4: 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');
});
示例5: function
hooks.beforeEach(async function() {
await visit('/');
window.Notification = {
permission: undefined,
};
notifications = getService<Notifications>('notifications');
});
示例6: function
hooks.beforeEach(async function() {
me = getService<CurrentUserService>('currentUser').record!;
await createContact('First Contact');
await createContact('Second Contact');
await visit('/contacts');
});
示例7: 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');
}
示例8: function
hooks.beforeEach(async function() {
stubService('currentUser', {
isLoggedIn: false,
load() {},
exists: () => false,
});
await visit('/logout');
});
示例9: test
test('Search tracks correctly', async function(assert) {
const searchTerm = 'somerandomsearch';
const SEARCH_EVENT_NAME = 'trackSiteSearch';
await appLogin();
await visit(`/search?keyword=${searchTerm}`);
const [, keyword] = getTrackingEvent(SEARCH_EVENT_NAME);
assert.equal(keyword, searchTerm, 'Search should be tracked correctly');
});
示例10: test
test('it automatically finds keys when attached to container-managed objects', async function(assert) {
await visit('/');
const appRoute = this.owner.lookup('route:application');
appRoute.debug('test message from the application route');
let [routeMessage] = log.lastCall.args;
assert.ok(/route:application/.test(routeMessage), 'Route message should include its container key');
const testService = this.owner.lookup('service:my/test/module');
testService.debug('test message from the mysterious service');
let [serviceMessage] = log.lastCall.args;
assert.ok(/service:my\/test\/module/.test(serviceMessage), 'Service message should include its container key');
});