Sha256: 929c60358999b96a1bb16fb99cc828727d9e76ec76a829d8cef240e1e93dd26a
Contents?: true
Size: 1.33 KB
Versions: 1
Compression:
Stored size: 1.33 KB
Contents
import Controller from '@ember/controller'; import { moduleFor, ApplicationTestCase } from 'internal-test-helpers'; import { Component } from '@ember/-internals/glimmer'; /* In Ember 1.x, controllers subtly affect things like template scope and action targets in exciting and often inscrutable ways. This test file contains integration tests that verify the correct behavior of the many parts of the system that change and rely upon controller scope, from the runtime up to the templating layer. */ moduleFor( 'Template scoping examples', class extends ApplicationTestCase { ['@test Actions inside an outlet go to the associated controller'](assert) { this.add( 'controller:index', Controller.extend({ actions: { componentAction() { assert.ok(true, 'controller received the action'); }, }, }) ); this.addComponent('component-with-action', { ComponentClass: Component.extend({ classNames: ['component-with-action'], click() { this.action(); }, }), }); this.addTemplate('index', '{{component-with-action action=(action "componentAction")}}'); return this.visit('/').then(() => { this.runTask(() => this.$('.component-with-action').click()); }); } } );
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
discourse-ember-source-3.6.0.0 | dist/es/ember/tests/controller_test.js |