From e96d160f2b84f2a52c96fbf3ff0921e85c68953d Mon Sep 17 00:00:00 2001 From: Alex LaFroscia Date: Mon, 4 Feb 2019 22:16:31 -0800 Subject: [PATCH] chore: move routes for acceptance testing --- tests/acceptance/observable-model-test.js | 14 +++++++------- .../testing}/observable-model/route.js | 0 .../testing}/observable-model/template.hbs | 0 tests/dummy/app/router.js | 4 +++- tests/dummy/config/environment.js | 19 ++++++++++--------- 5 files changed, 20 insertions(+), 17 deletions(-) rename tests/dummy/app/{ => pods/testing}/observable-model/route.js (100%) rename tests/dummy/app/{ => pods/testing}/observable-model/template.hbs (100%) diff --git a/tests/acceptance/observable-model-test.js b/tests/acceptance/observable-model-test.js index cbf5502..b6aad77 100644 --- a/tests/acceptance/observable-model-test.js +++ b/tests/acceptance/observable-model-test.js @@ -12,7 +12,7 @@ module("Acceptance | observable model", function(hooks) { setupScheduler(hooks); test("it handles multiple values over time", async function(assert) { - this.owner.lookup("route:observable-model").model = () => { + this.owner.lookup("route:testing/observable-model").model = () => { return merge( of(1), of(2).pipe(delay(100, this.scheduler)), @@ -20,7 +20,7 @@ module("Acceptance | observable model", function(hooks) { ); }; - await visit("/observable-model"); + await visit("/testing/observable-model"); assert.dom().hasText("1", "Model hook resolves with the initial value"); @@ -34,23 +34,23 @@ module("Acceptance | observable model", function(hooks) { }); test("it takes the latest value if multiple are emitted before resolution", async function(assert) { - this.owner.lookup("route:observable-model").model = () => { + this.owner.lookup("route:testing/observable-model").model = () => { return of(1, 2); }; - await visit("/observable-model"); + await visit("/testing/observable-model"); assert.dom().hasText("2", "Model used the later value"); }); module("unsubscribing from later values", function(hooks) { hooks.beforeEach(async function(assert) { - const route = this.owner.lookup("route:observable-model"); + const route = this.owner.lookup("route:testing/observable-model"); route.model = () => { return merge(of(1), of(2).pipe(delay(100, this.scheduler))); }; - await visit("/observable-model"); + await visit("/testing/observable-model"); this.subscription = route[LATER_VALUE_SUBSCRIPTION]; td.replace(this.subscription, "unsubscribe"); @@ -81,7 +81,7 @@ module("Acceptance | observable model", function(hooks) { }); test("when the model hook is refreshed", async function(assert) { - await visit("/observable-model?page=2"); + await visit("/testing/observable-model?page=2"); assert.verify( this.subscription.unsubscribe(), diff --git a/tests/dummy/app/observable-model/route.js b/tests/dummy/app/pods/testing/observable-model/route.js similarity index 100% rename from tests/dummy/app/observable-model/route.js rename to tests/dummy/app/pods/testing/observable-model/route.js diff --git a/tests/dummy/app/observable-model/template.hbs b/tests/dummy/app/pods/testing/observable-model/template.hbs similarity index 100% rename from tests/dummy/app/observable-model/template.hbs rename to tests/dummy/app/pods/testing/observable-model/template.hbs diff --git a/tests/dummy/app/router.js b/tests/dummy/app/router.js index d9b2286..5c219f4 100644 --- a/tests/dummy/app/router.js +++ b/tests/dummy/app/router.js @@ -7,7 +7,9 @@ const Router = EmberRouter.extend({ }); Router.map(function() { - this.route('observable-model'); + this.route("testing", function() { + this.route("observable-model"); + }); }); export default Router; diff --git a/tests/dummy/config/environment.js b/tests/dummy/config/environment.js index 182d3fc..4fd7adc 100644 --- a/tests/dummy/config/environment.js +++ b/tests/dummy/config/environment.js @@ -1,11 +1,12 @@ -'use strict'; +"use strict"; module.exports = function(environment) { let ENV = { - modulePrefix: 'dummy', + modulePrefix: "dummy", + podModulePrefix: "dummy/pods", environment, - rootURL: '/', - locationType: 'auto', + rootURL: "/", + locationType: "auto", EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build @@ -23,7 +24,7 @@ module.exports = function(environment) { } }; - if (environment === 'development') { + if (environment === "development") { // ENV.APP.LOG_RESOLVER = true; // ENV.APP.LOG_ACTIVE_GENERATION = true; // ENV.APP.LOG_TRANSITIONS = true; @@ -31,19 +32,19 @@ module.exports = function(environment) { // ENV.APP.LOG_VIEW_LOOKUPS = true; } - if (environment === 'test') { + if (environment === "test") { // Testem prefers this... - ENV.locationType = 'none'; + ENV.locationType = "none"; // keep test console output quieter ENV.APP.LOG_ACTIVE_GENERATION = false; ENV.APP.LOG_VIEW_LOOKUPS = false; - ENV.APP.rootElement = '#ember-testing'; + ENV.APP.rootElement = "#ember-testing"; ENV.APP.autoboot = false; } - if (environment === 'production') { + if (environment === "production") { // here you can enable a production-specific feature }