本文整理匯總了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');
});