How to use the @ember/test-helpers.visit function in @ember/test-helpers

To help you get started, we’ve selected a few @ember/test-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CenterForOpenScience / ember-osf-web / tests / helpers / index.ts View on Github external
export async function visit(url: string) {
    try {
        await _visit(url);
    } catch (e) {
        if (e.message !== 'TransitionAborted') {
            throw e;
        }

        // Set this.element for application tests as the original
        // visit's attempt to do so was interupted by an exception
        const context: any = getContext();
        context.element = document.querySelector('#ember-testing');
    }

    await settled();
}
github emberobserver / client / tests / helpers / visit-addon.js View on Github external
export default async function visitAddon(addon) {
  return visit(`/addons/${addon.name}`);
}
github ember-codemods / ember-test-helpers-codemod / transforms / acceptance / __testfixtures__ / visit.output.js View on Github external
test('visiting /bar', async function(assert) {
  await visit('/bar');
  assert.equal(currentURL(), '/bar');
});
github ember-codemods / ember-test-helpers-codemod / transforms / acceptance / __testfixtures__ / visit.output.js View on Github external
test('visiting /foo', async function(assert) {
  await visit('/foo');
  assert.equal(currentURL(), '/foo');
});
github ember-codemods / ember-test-helpers-codemod / transforms / acceptance / __testfixtures__ / click.output.js View on Github external
test('visiting /foo', async function(assert) {
  await visit('/foo');

  await click('#bar');
  await click(findAll('.baz a')[12]);
  assert.equal(currentURL(), '/foo');
});
github ember-codemods / ember-test-helpers-codemod / transforms / acceptance / __testfixtures__ / andthen.output.js View on Github external
test('visiting /foo', async function(assert) {
  await visit('/foo');
  assert.ok(true);
});
github ember-codemods / ember-test-helpers-codemod / transforms / acceptance / __testfixtures__ / route-helpers.output.js View on Github external
test('visiting /foo', async function(assert) {
  await visit('/foo');
  assert.equal(currentURL(), '/foo');
  assert.equal(currentPath(), 'foo.index');
  assert.equal(currentRouteName(), 'foo');
});
github cardstack / cardstack / packages / test-support / addon-test-support / card-ui-helpers.js View on Github external
export async function createCards(args) {
  for (let id of Object.keys(args)) {
    await visit('/cards/new');
    await setCardId(id);
    for (let [index, [name, type, neededWhenEmbedded]] of args[id].entries()) {
      await addField(name, type, neededWhenEmbedded, index);
    }
    await click('[data-test-card-save-btn]');
    await waitFor(`[data-test-card-schema="${id}"]`, { timeout });

    await visit(`/cards/${id}/edit`);
    for (let [name, , , value] of args[id]) {
      if (value == null) {
        continue;
      }
      await setFieldValue(name, value);
    }
    await saveCard('editor', id);
    await visit(`/cards/${id}`);
github DefinitelyTyped / DefinitelyTyped / types / ember__test-helpers / ember__test-helpers-tests.ts View on Github external
test('routing helpers', async (assert) => {
    await visit('/foo');

    assert.equal(currentURL(), '/foo');
    assert.equal(currentRouteName(), 'foo');
});
github san650 / ember-cli-page-object / tests / helpers / properties / application-adapter.js View on Github external
function visit(...args) {
  return require('@ember/test-helpers').visit(...args);
}