Sha256: 7f0fcbb3d06b6be2ac6ea1edb11cd266529036e13f3d6db92ac1fa4d5609219d
Contents?: true
Size: 1.24 KB
Versions: 3
Compression:
Stored size: 1.24 KB
Contents
import { subscribe, reset } from '@ember/instrumentation'; import { moduleFor, ApplicationTestCase } from 'internal-test-helpers'; moduleFor( 'View Instrumentation', class extends ApplicationTestCase { constructor() { super(); this.addTemplate('application', `{{outlet}}`); this.addTemplate('index', `<h1>Index</h1>`); this.addTemplate('posts', `<h1>Posts</h1>`); this.router.map(function() { this.route('posts'); }); } teardown() { reset(); super.teardown(); } ['@test Nodes without view instances are instrumented'](assert) { let called = false; subscribe('render', { before() { called = true; }, after() {}, }); return this.visit('/') .then(() => { assert.equal(this.textValue(), 'Index', 'It rendered the correct template'); assert.ok(called, 'Instrumentation called on first render'); called = false; return this.visit('/posts'); }) .then(() => { assert.equal(this.textValue(), 'Posts', 'It rendered the correct template'); assert.ok(called, 'Instrumentation called on transition to non-view backed route'); }); } } );
Version data entries
3 entries across 3 versions & 1 rubygems