Sha256: 998a3a1c1cd4820d0b628ec006adc49cf2ea8ccbae6a0821c3584c1f3c4f9e1a

Contents?: true

Size: 1.32 KB

Versions: 1

Compression:

Stored size: 1.32 KB

Contents

import { RenderingTest, moduleFor } from '../utils/test-case';
import { strip } from '../utils/abstract-test-case';
import { set } from '@ember/-internals/metal';

moduleFor(
  'syntax refinements',
  class extends RenderingTest {
    ['@test block params should not be refined']() {
      this.registerHelper('foo', () => 'bar helper');

      this.render(
        strip`
      {{#with var as |foo|}}
        {{foo}}
      {{/with}}

      ---

      {{#with var as |outlet|}}
        {{outlet}}
      {{/with}}

      ---

      {{#with var as |mount|}}
        {{mount}}
      {{/with}}

      ---

      {{#with var as |component|}}
        {{component}}
      {{/with}}

      ---

      {{#with var as |input|}}
        {{input}}
      {{/with}}

      ---

      {{#with var as |-with-dynamic-vars|}}
        {{-with-dynamic-vars}}
      {{/with}}

      ---

      {{#with var as |-in-element|}}
        {{-in-element}}
      {{/with}}`,
        { var: 'var' }
      );

      this.assertText('var---var---var---var---var---var---var');

      this.runTask(() => set(this.context, 'var', 'RARRR!!!'));

      this.assertText('RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!');

      this.runTask(() => set(this.context, 'var', 'var'));

      this.assertText('var---var---var---var---var---var---var');
    }
  }
);

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/@ember/-internals/glimmer/tests/integration/refinements-test.js