diff --git a/wherehows-web/app/reducers/entities/entities.js b/wherehows-web/app/reducers/entities/entities.js index 4de3368410..19a0239d5c 100644 --- a/wherehows-web/app/reducers/entities/entities.js +++ b/wherehows-web/app/reducers/entities/entities.js @@ -78,7 +78,7 @@ const entitiesToPage = ( * @param {Array} nodes * @return {Object} */ -const urnsToNodeUrn = (state, { nodes = [] }) => { +const urnsToNodeUrn = (state, { data: nodes = [] }) => { const { query: { urn }, nodesByUrn } = state; return Object.assign({}, nodesByUrn, { [urn]: union(nodes) @@ -120,7 +120,7 @@ const createPageMapping = entityName => (state, payload = {}) => { * Takes the response from the list api request and invokes a function to * map a urn to child urns or nodes * @param {Object} state - * @param {Object} payload + * @param {Object} payload the response from the list endpoint/api * @return {Object} */ const receiveNodes = (state, payload = {}) => urnsToNodeUrn(state, payload); diff --git a/wherehows-web/tests/integration/components/browser/browser-rail-test.js b/wherehows-web/tests/integration/components/browser/browser-rail-test.js new file mode 100644 index 0000000000..e4da8dd3b4 --- /dev/null +++ b/wherehows-web/tests/integration/components/browser/browser-rail-test.js @@ -0,0 +1,25 @@ +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('browser/browser-rail', 'Integration | Component | browser/browser rail', { + integration: true +}); + +test('it renders', function(assert) { + + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.on('myAction', function(val) { ... }); + + this.render(hbs`{{browser/browser-rail}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage: + this.render(hbs` + {{#browser/browser-rail}} + template block text + {{/browser/browser-rail}} + `); + + assert.equal(this.$().text().trim(), 'template block text'); +}); diff --git a/wherehows-web/tests/integration/components/browser/containers/browser-rail-test.js b/wherehows-web/tests/integration/components/browser/containers/browser-rail-test.js new file mode 100644 index 0000000000..6db3222dda --- /dev/null +++ b/wherehows-web/tests/integration/components/browser/containers/browser-rail-test.js @@ -0,0 +1,25 @@ +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('browser/containers/browser-rail', 'Integration | Component | browser/containers/browser rail', { + integration: true +}); + +test('it renders', function(assert) { + + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.on('myAction', function(val) { ... }); + + this.render(hbs`{{browser/containers/browser-rail}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage: + this.render(hbs` + {{#browser/containers/browser-rail}} + template block text + {{/browser/containers/browser-rail}} + `); + + assert.equal(this.$().text().trim(), 'template block text'); +}); diff --git a/wherehows-web/tests/integration/components/browser/containers/browser-viewport-test.js b/wherehows-web/tests/integration/components/browser/containers/browser-viewport-test.js new file mode 100644 index 0000000000..fdd98b75b1 --- /dev/null +++ b/wherehows-web/tests/integration/components/browser/containers/browser-viewport-test.js @@ -0,0 +1,25 @@ +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('browser/containers/browser-viewport', 'Integration | Component | browser/containers/browser viewport', { + integration: true +}); + +test('it renders', function(assert) { + + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.on('myAction', function(val) { ... }); + + this.render(hbs`{{browser/containers/browser-viewport}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage: + this.render(hbs` + {{#browser/containers/browser-viewport}} + template block text + {{/browser/containers/browser-viewport}} + `); + + assert.equal(this.$().text().trim(), 'template block text'); +}); diff --git a/wherehows-web/tests/integration/components/search/link-group-test.js b/wherehows-web/tests/integration/components/search/link-group-test.js new file mode 100644 index 0000000000..2606c86613 --- /dev/null +++ b/wherehows-web/tests/integration/components/search/link-group-test.js @@ -0,0 +1,25 @@ +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('search/link-group', 'Integration | Component | search/link group', { + integration: true +}); + +test('it renders', function(assert) { + + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.on('myAction', function(val) { ... }); + + this.render(hbs`{{search/link-group}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage: + this.render(hbs` + {{#search/link-group}} + template block text + {{/search/link-group}} + `); + + assert.equal(this.$().text().trim(), 'template block text'); +}); diff --git a/wherehows-web/tests/unit/controllers/browse/entity-test.js b/wherehows-web/tests/unit/controllers/browse/entity-test.js new file mode 100644 index 0000000000..044ce386a4 --- /dev/null +++ b/wherehows-web/tests/unit/controllers/browse/entity-test.js @@ -0,0 +1,12 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:browse/entity', 'Unit | Controller | browse/entity', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +});