mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-31 12:52:13 +00:00
adds default tests. updates local reference to nodes in reducers.entities.entities
This commit is contained in:
parent
2c85fc05ed
commit
c1c27bb6e5
@ -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);
|
||||
|
@ -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');
|
||||
});
|
@ -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');
|
||||
});
|
@ -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');
|
||||
});
|
@ -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');
|
||||
});
|
12
wherehows-web/tests/unit/controllers/browse/entity-test.js
Normal file
12
wherehows-web/tests/unit/controllers/browse/entity-test.js
Normal 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);
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user