adds default tests. updates local reference to nodes in reducers.entities.entities

This commit is contained in:
Seyi Adebajo 2017-04-26 00:18:40 -07:00 committed by Mars Lan
parent 2c85fc05ed
commit c1c27bb6e5
6 changed files with 114 additions and 2 deletions

View File

@ -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);

View File

@ -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');
});

View File

@ -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');
});

View File

@ -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');
});

View File

@ -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');
});

View File

@ -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);
});