How to use the ember-qunit.setupRenderingTest function in ember-qunit

To help you get started, we’ve selected a few ember-qunit 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 emberjs / ember.js / node-tests / fixtures / helper-test / rfc232.js View on Github external
module('Integration | Helper | foo/bar-baz', function(hooks) {
  setupRenderingTest(hooks);

  // Replace this with your real tests.
  test('it renders', async function(assert) {
    this.set('inputValue', '1234');

    await render(hbs`{{foo/bar-baz inputValue}}`);

    assert.equal(this.element.textContent.trim(), '1234');
  });
});
github emberjs / ember.js / node-tests / fixtures / component-test / rfc232.js View on Github external
module('Integration | Component | x-foo', function(hooks) {
  setupRenderingTest(hooks);

  test('it renders', async function(assert) {
    // Set any properties with this.set('myProperty', 'value');
    // Handle any actions with this.set('myAction', function(val) { ... });

    await render(hbs``);

    assert.equal(this.element.textContent.trim(), '');

    // Template block usage:
    await render(hbs`
      
        template block text
      
    `);
github NYCPlanning / labs-zap-search / tests / integration / helpers / lookup-action-type.js View on Github external
module('Integration | Helper | lookup-action-type', function(hooks) {
  setupRenderingTest(hooks);

  // Replace this with your real tests.
  test('it returns the expected action type', async function(assert) {
    this.set('inputValue', 'ZM');

    await render(hbs`{{lookup-action-type inputValue}}`);

    assert.equal(this.element.textContent.trim(), '(ULURP) A Zoning Map Amendment is a change in designation or a change in district boundaries for any zoning district on the New York City Zoning Map.  Zoning Map Amendments are discretionary actions subject to the Uniform Land Use Review Procedure.');
  });
});
github miguelcobain / ember-leaflet / tests / integration / components / base-layer-test-disabled.js View on Github external
module('Integration | Component | base layer', function(hooks) {
  setupRenderingTest(hooks);

  test('using any layer without the createLayer implemented throws', function(assert) {
    assert.expect(1);

    this.set('center', locations.nyc);
    this.set('zoom', 13);

    assert.throws(async () => {
      await render(hbs`
        {{#leaflet-map zoom=zoom center=center}}
          {{base-layer}}
        {{/leaflet-map}}`);
    }, /Assertion Failed: BaseLayer's `createLayer` should be overriden./);
  });

  test('using any layer outside a content layer throws', function(assert) {
github sandydoo / ember-google-maps / tests / helpers / g-map-helpers.js View on Github external
module(name, function(hooks) {
    setupRenderingTest(hooks);

    hooks.beforeEach(function() {
      setProperties(this, london);

      let testContext = this;
      let waiterFulfilled = false;

      this.owner.register('component:g-map', GMapComponent.extend({
        init() {
          this._super(...arguments);

          registerWaiter(() => {
            if (this._componentsInitialized === true) {
              if (!waiterFulfilled) {
                let { id, components, map } = this.publicAPI;
                setProperties(testContext, { id, components, map });
github sir-dunxalot / ember-google-charts / tests / integration / components / language-test-REMOVED.js View on Github external
module('Integration | Component | chart language', function(hooks) {
  setupRenderingTest(hooks);

  hooks.beforeEach(function() {
    this.actions = {};
    this.send = (actionName, ...args) => this.actions[actionName].apply(this, args);
  });

  test('Setting language', async function(assert) {
    assert.expect(1);

    const done = assert.async();

    this.setProperties({
      data,
      options: {
        hAxis: { format: 'MMMM' },
      },
github miguelcobain / ember-paper / tests / integration / components / base-focusable.js View on Github external
module('Integration | Component | base focusable', function(hooks) {
  setupRenderingTest(hooks);

  test('should set and remove disabled attribute', async function(assert) {

    this.set('value', true);
    await render(hbs`{{base-focusable id="base-focusable" disabled=value}}`);
    assert.equal(this.$('#base-focusable').attr('disabled').trim(), 'disabled');

    this.set('value', false);
    assert.ok(!this.$('md-checkbox').attr('disabled'));
  });
});
github CenterForOpenScience / ember-osf-web / tests / helpers / engines.ts View on Github external
export function setupEngineRenderingTest(hooks: any, engine: string) {
    setupRenderingTest(hooks, { resolver: engineResolverFor(engine) });
    setupEngineFixtures(hooks);
}
github CenterForOpenScience / ember-osf-web / tests / helpers / osf-qunit.ts View on Github external
export function setupRenderingTest(hooks: NestedHooks, options?: SetupTestOptions) {
    emberQunitSetupRenderingTest(hooks, options);
    injectCustomAssertions(hooks);
}
github cardstack / cardstack / packages / test-support / addon-test-support / test-helpers.js View on Github external
export function setupCardTest(hooks) {
  setupRenderingTest(hooks);
  setupCardTestComponent(hooks);
  setupURLs(hooks);
}