Sha256: 0997bc23404012fed722ca77a5df1a6bf1c1d43aa0721ac7124a308c92a812a0

Contents?: true

Size: 1.24 KB

Versions: 3

Compression:

Stored size: 1.24 KB

Contents

import { moduleFor, RenderingTest } from '../../utils/test-case';
import { strip } from '../../utils/abstract-test-case';

moduleFor(
  '{{-with-dynamic-var}}',
  class extends RenderingTest {
    ['@test does not allow setting values other than outletState']() {
      expectAssertion(() => {
        this.render(strip`
        {{#-with-dynamic-vars foo="bar"}}
          {{-get-dynamic-var 'foo'}}
        {{/-with-dynamic-vars}}
      `);
      }, /Using `-with-dynamic-scope` is only supported for `outletState` \(you used `foo`\)./);
    }

    ['@test allows setting/getting outletState']() {
      // this is simply asserting that we can write and read outletState
      // the actual value being used here is not what is used in real life
      // feel free to change the value being set and asserted as needed
      this.render(strip`
      {{#-with-dynamic-vars outletState="bar"}}
        {{-get-dynamic-var 'outletState'}}
      {{/-with-dynamic-vars}}
    `);

      this.assertText('bar');
    }

    ['@test does not allow setting values other than outletState']() {
      expectAssertion(() => {
        this.render(`{{-get-dynamic-var 'foo'}}`);
      }, /Using `-get-dynamic-scope` is only supported for `outletState` \(you used `foo`\)./);
    }
  }
);

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/@ember/-internals/glimmer/tests/integration/syntax/with-dynamic-var-test.js
discourse-ember-source-3.5.1.1 dist/es/ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js