mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-17 13:45:54 +00:00
Bumped a bunch of dependencies. Mirage needed some work. Added ember and yarn scripts that runs same version of node as prod
This commit is contained in:
parent
380c698410
commit
41cf965400
@ -42,6 +42,19 @@ task emberCoverage(type: NodeTask, dependsOn: emberTest) {
|
|||||||
args = ['-f', 'coverage/coverage-final.json']
|
args = ['-f', 'coverage/coverage-final.json']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task execEmber(type: NodeTask) {
|
||||||
|
script = file('node_modules/.bin/ember')
|
||||||
|
if ( project.hasProperty('emberArgs') ) {
|
||||||
|
args = emberArgs.tokenize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task execYarn(type: YarnTask) {
|
||||||
|
if ( project.hasProperty('yarnArgs') ) {
|
||||||
|
args = yarnArgs.tokenize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
clean {
|
clean {
|
||||||
delete 'node_modules'
|
delete 'node_modules'
|
||||||
delete 'bower_components'
|
delete 'bower_components'
|
||||||
|
@ -23,7 +23,6 @@ export interface IMirageServer {
|
|||||||
loadFactories: (factoryMap: object) => void;
|
loadFactories: (factoryMap: object) => void;
|
||||||
create: (type: string, options?: object) => object;
|
create: (type: string, options?: object) => object;
|
||||||
createList: <T>(type: string, amount: number, traitsAndOverrides?: object | string) => Array<T>;
|
createList: <T>(type: string, amount: number, traitsAndOverrides?: object | string) => Array<T>;
|
||||||
shutdown: (this: IMirageServer) => void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,6 +74,10 @@ module.exports = function(environment) {
|
|||||||
|
|
||||||
ENV.APP.rootElement = '#ember-testing';
|
ENV.APP.rootElement = '#ember-testing';
|
||||||
ENV.APP.autoboot = false;
|
ENV.APP.autoboot = false;
|
||||||
|
ENV['ember-cli-mirage'] = {
|
||||||
|
enabled: true,
|
||||||
|
autostart: true
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (environment === 'production') {
|
if (environment === 'production') {
|
||||||
|
@ -27,7 +27,9 @@ export default Factory.extend({
|
|||||||
tbl_type: 'VIRTUAL_VIEW',
|
tbl_type: 'VIRTUAL_VIEW',
|
||||||
view_expanded_text: faker.lorem.sentence()
|
view_expanded_text: faker.lorem.sentence()
|
||||||
}),
|
}),
|
||||||
schema: 'abcd',
|
|
||||||
|
// TODO https://github.com/samselikoff/ember-cli-mirage/issues/1379
|
||||||
|
whSchema: 'abcd',
|
||||||
source: 'Hive',
|
source: 'Hive',
|
||||||
urn: faker.internet.url(),
|
urn: faker.internet.url(),
|
||||||
watchId: 0,
|
watchId: 0,
|
||||||
@ -37,8 +39,15 @@ export default Factory.extend({
|
|||||||
id(id: number) {
|
id(id: number) {
|
||||||
return id;
|
return id;
|
||||||
},
|
},
|
||||||
schema(id: number) {
|
|
||||||
|
// TODO https://github.com/samselikoff/ember-cli-mirage/issues/1379
|
||||||
|
whSchema(id: number) {
|
||||||
return id === 0 ? testSchemaA : 'abcd';
|
return id === 0 ? testSchemaA : 'abcd';
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
|
|
||||||
|
// TODO https://github.com/samselikoff/ember-cli-mirage/issues/1379
|
||||||
|
afterCreate(dataset: any) {
|
||||||
|
dataset.attrs.schema = dataset.attrs.whSchema;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { IFunctionRouteHandler } from 'wherehows-web/typings/ember-cli-mirage';
|
import { IFunctionRouteHandler } from 'wherehows-web/typings/ember-cli-mirage';
|
||||||
|
|
||||||
export const getDatasetHealth = function(this: IFunctionRouteHandler, { db: healths }: any) {
|
export const getDatasetHealth = function(this: IFunctionRouteHandler, { db: { healths } }: any) {
|
||||||
return {
|
return {
|
||||||
health: this.serialize(healths[0])
|
health: this.serialize(healths[0])
|
||||||
};
|
};
|
||||||
|
@ -28,17 +28,17 @@
|
|||||||
"@types/lodash": "^4.14.83",
|
"@types/lodash": "^4.14.83",
|
||||||
"@types/qunit": "^2.5.2",
|
"@types/qunit": "^2.5.2",
|
||||||
"@types/rsvp": "^4.0.2",
|
"@types/rsvp": "^4.0.2",
|
||||||
"@zestia/ember-simple-infinite-scroller": "^2.0.2",
|
"@zestia/ember-simple-infinite-scroller": "^3.0.2",
|
||||||
"babel-plugin-transform-async-to-generator": "^6.24.1",
|
"babel-plugin-transform-async-to-generator": "^6.24.1",
|
||||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||||
"babel-plugin-transform-es2015-destructuring": "^6.23.0",
|
"babel-plugin-transform-es2015-destructuring": "^6.23.0",
|
||||||
"babel-plugin-transform-es2015-parameters": "^6.24.1",
|
"babel-plugin-transform-es2015-parameters": "^6.24.1",
|
||||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||||
"broccoli-asset-rev": "^2.7.0",
|
"broccoli-asset-rev": "^3.0.0",
|
||||||
"broccoli-funnel": "^2.0.1",
|
"broccoli-funnel": "^2.0.1",
|
||||||
"broccoli-merge-trees": "^3.0.0",
|
"broccoli-merge-trees": "^3.0.0",
|
||||||
"codecov": "^3.0.0",
|
"codecov": "^3.0.0",
|
||||||
"ember-ace": "^1.3.1",
|
"ember-ace": "^2.0.0",
|
||||||
"ember-ajax": "^3.0.0",
|
"ember-ajax": "^3.0.0",
|
||||||
"ember-basic-dropdown": "^1.0.0",
|
"ember-basic-dropdown": "^1.0.0",
|
||||||
"ember-cli": "^3.3.0",
|
"ember-cli": "^3.3.0",
|
||||||
@ -46,11 +46,11 @@
|
|||||||
"ember-cli-babel": "^6.12.0",
|
"ember-cli-babel": "^6.12.0",
|
||||||
"ember-cli-bootstrap-sassy": "^0.5.8",
|
"ember-cli-bootstrap-sassy": "^0.5.8",
|
||||||
"ember-cli-code-coverage": "^1.0.0-beta.4",
|
"ember-cli-code-coverage": "^1.0.0-beta.4",
|
||||||
"ember-cli-dependency-checker": "^2.0.0",
|
"ember-cli-dependency-checker": "^3.0.0",
|
||||||
"ember-cli-dependency-lint": "^1.0.3",
|
"ember-cli-dependency-lint": "^1.0.3",
|
||||||
"ember-cli-eslint": "^4.2.1",
|
"ember-cli-eslint": "^4.2.1",
|
||||||
"ember-cli-eyeglass": "^5.0.0",
|
"ember-cli-eyeglass": "^5.0.0",
|
||||||
"ember-cli-htmlbars": "^2.0.1",
|
"ember-cli-htmlbars": "^3.0.0",
|
||||||
"ember-cli-htmlbars-inline-precompile": "^1.0.0",
|
"ember-cli-htmlbars-inline-precompile": "^1.0.0",
|
||||||
"ember-cli-inject-live-reload": "^1.4.1",
|
"ember-cli-inject-live-reload": "^1.4.1",
|
||||||
"ember-cli-moment-shim": "^3.5.0",
|
"ember-cli-moment-shim": "^3.5.0",
|
||||||
@ -64,23 +64,24 @@
|
|||||||
"ember-concurrency": "^0.8.15",
|
"ember-concurrency": "^0.8.15",
|
||||||
"ember-decorators": "^2.0.0",
|
"ember-decorators": "^2.0.0",
|
||||||
"ember-export-application-global": "^2.0.0",
|
"ember-export-application-global": "^2.0.0",
|
||||||
"ember-fetch": "^5.1.1",
|
"ember-fetch": "5.1.1",
|
||||||
"ember-font-awesome": "^4.0.0-rc.2",
|
"ember-font-awesome": "^4.0.0-rc.2",
|
||||||
"ember-highcharts": "^1.0.0",
|
"ember-highcharts": "^1.0.0",
|
||||||
"ember-inflector": "^2.2.0",
|
"ember-inflector": "2.3.0",
|
||||||
"ember-load-initializers": "^1.0.0",
|
"ember-load-initializers": "^1.0.0",
|
||||||
"ember-math-helpers": "^2.4.0",
|
"ember-math-helpers": "^2.4.0",
|
||||||
"ember-medium-editor": "^0.1.4",
|
"ember-medium-editor": "^0.1.4",
|
||||||
"ember-metrics": "^0.12.1",
|
"ember-metrics": "^0.12.1",
|
||||||
"ember-power-calendar": "^0.7.1",
|
"ember-power-calendar": "^0.9.0",
|
||||||
|
"ember-power-calendar-moment": "^0.1.3",
|
||||||
"ember-power-select-typeahead": "^0.7.0",
|
"ember-power-select-typeahead": "^0.7.0",
|
||||||
"ember-resolver": "^4.0.0",
|
"ember-resolver": "^5.0.1",
|
||||||
"ember-sinon": "^1.0.1",
|
"ember-sinon": "^1.0.1",
|
||||||
"ember-sinon-qunit": "^2.1.0",
|
"ember-sinon-qunit": "^2.1.0",
|
||||||
"ember-source": "^3.3.1",
|
"ember-source": "^3.3.1",
|
||||||
"ember-symbol-observable": "^1.0.1",
|
"ember-symbol-observable": "^1.0.1",
|
||||||
"eslint": "^4.15.0",
|
"eslint": "^5.4.0",
|
||||||
"eslint-config-prettier": "^2.9.0",
|
"eslint-config-prettier": "^3.0.1",
|
||||||
"eslint-plugin-ember": "^5.0.0",
|
"eslint-plugin-ember": "^5.0.0",
|
||||||
"eslint-plugin-import": "^2.8.0",
|
"eslint-plugin-import": "^2.8.0",
|
||||||
"eslint-plugin-prettier": "^2.6.2",
|
"eslint-plugin-prettier": "^2.6.2",
|
||||||
@ -99,7 +100,7 @@
|
|||||||
"bootstrap": "3.3.7",
|
"bootstrap": "3.3.7",
|
||||||
"dynamic-link": "^0.2.3",
|
"dynamic-link": "^0.2.3",
|
||||||
"ember-aupac-typeahead": "3.1.0",
|
"ember-aupac-typeahead": "3.1.0",
|
||||||
"ember-cli-mirage": "0.4.1",
|
"ember-cli-mirage": "^0.4.9",
|
||||||
"ember-cli-string-helpers": "^1.4.0",
|
"ember-cli-string-helpers": "^1.4.0",
|
||||||
"ember-lodash": "^4.18.0",
|
"ember-lodash": "^4.18.0",
|
||||||
"ember-modal-dialog": "^2.4.1",
|
"ember-modal-dialog": "^2.4.1",
|
||||||
@ -107,8 +108,8 @@
|
|||||||
"ember-power-select": "^2.0.4",
|
"ember-power-select": "^2.0.4",
|
||||||
"ember-radio-button": "^1.2.1",
|
"ember-radio-button": "^1.2.1",
|
||||||
"ember-simple-auth": "^1.4.0",
|
"ember-simple-auth": "^1.4.0",
|
||||||
"ember-tether": "0.4.1",
|
"ember-tether": "^1.0.0",
|
||||||
"ember-tooltips": "https://github.com/mattgraham1995/ember-tooltips#06112adb703f1701eef2257bf7690434af2c7444",
|
"ember-tooltips": "^2.10.0",
|
||||||
"ember-truth-helpers": "^2.0.0",
|
"ember-truth-helpers": "^2.0.0",
|
||||||
"eslint-plugin-typescript": "^0.12.0",
|
"eslint-plugin-typescript": "^0.12.0",
|
||||||
"font-awesome": "^4.7.0",
|
"font-awesome": "^4.7.0",
|
||||||
@ -116,10 +117,10 @@
|
|||||||
"jquery-jsonview": "^1.2.3",
|
"jquery-jsonview": "^1.2.3",
|
||||||
"jquery-treegrid": "^0.3.0",
|
"jquery-treegrid": "^0.3.0",
|
||||||
"json-human": "https://github.com/marianoguerra/json.human.js#0.1.1",
|
"json-human": "https://github.com/marianoguerra/json.human.js#0.1.1",
|
||||||
"marked": "^0.3.6",
|
"marked": "^0.5.0",
|
||||||
"medium-editor": "5.14.4",
|
"medium-editor": "^5.23.3",
|
||||||
"scrollmonitor": "^1.2.4",
|
"scrollmonitor": "^1.2.4",
|
||||||
"typescript-eslint-parser": "^17.0.1"
|
"typescript-eslint-parser": "^18.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8.*"
|
"node": ">= 8.*"
|
||||||
|
@ -14,7 +14,7 @@ module('Acceptance | datasets/dataset/comments', function(hooks) {
|
|||||||
// feature not yet supported in v2
|
// feature not yet supported in v2
|
||||||
skip('visiting /datasets/dataset/comments', async function(assert) {
|
skip('visiting /datasets/dataset/comments', async function(assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
defaultScenario(server);
|
defaultScenario(this.server);
|
||||||
const url = '/datasets/12345/comments';
|
const url = '/datasets/12345/comments';
|
||||||
|
|
||||||
await visit(url);
|
await visit(url);
|
||||||
|
@ -13,7 +13,7 @@ module('Acceptance | datasets/dataset/ownership', function(hooks) {
|
|||||||
|
|
||||||
skip('visiting /datasets/dataset/ownership', async function(assert) {
|
skip('visiting /datasets/dataset/ownership', async function(assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
defaultScenario(server);
|
defaultScenario(this.server);
|
||||||
const url = '/datasets/12345/ownership';
|
const url = '/datasets/12345/ownership';
|
||||||
|
|
||||||
await visit(url);
|
await visit(url);
|
||||||
|
@ -13,7 +13,7 @@ module('Acceptance | datasets/dataset/properties', function(hooks) {
|
|||||||
|
|
||||||
skip('visiting /datasets/dataset/properties', async function(assert) {
|
skip('visiting /datasets/dataset/properties', async function(assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
defaultScenario(server);
|
defaultScenario(this.server);
|
||||||
const url = '/datasets/12345/properties';
|
const url = '/datasets/12345/properties';
|
||||||
|
|
||||||
await visit(url);
|
await visit(url);
|
||||||
|
@ -13,7 +13,7 @@ module('Acceptance | datasets/dataset/relationships', function(hooks) {
|
|||||||
|
|
||||||
skip('visiting /datasets/dataset/relationships', async function(assert) {
|
skip('visiting /datasets/dataset/relationships', async function(assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
defaultScenario(server);
|
defaultScenario(this.server);
|
||||||
const url = '/datasets/12345/relationships';
|
const url = '/datasets/12345/relationships';
|
||||||
|
|
||||||
await visit(url);
|
await visit(url);
|
||||||
|
@ -13,7 +13,7 @@ module('Acceptance | datasets/dataset/sample', function(hooks) {
|
|||||||
|
|
||||||
skip('visiting /datasets/dataset/sample', async function(assert) {
|
skip('visiting /datasets/dataset/sample', async function(assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
defaultScenario(server);
|
defaultScenario(this.server);
|
||||||
const url = '/datasets/12345/sample';
|
const url = '/datasets/12345/sample';
|
||||||
|
|
||||||
await visit(url);
|
await visit(url);
|
||||||
|
@ -13,7 +13,7 @@ module('Acceptance | datasets/dataset/schema', function(hooks) {
|
|||||||
|
|
||||||
skip('visiting /datasets/dataset/schema', async function(assert) {
|
skip('visiting /datasets/dataset/schema', async function(assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
defaultScenario(server);
|
defaultScenario(this.server);
|
||||||
const url = '/datasets/12345/schema';
|
const url = '/datasets/12345/schema';
|
||||||
|
|
||||||
await visit(url);
|
await visit(url);
|
||||||
|
@ -2,21 +2,11 @@ import { module, test } from 'qunit';
|
|||||||
import { setupRenderingTest } from 'ember-qunit';
|
import { setupRenderingTest } from 'ember-qunit';
|
||||||
import { render } from '@ember/test-helpers';
|
import { render } from '@ember/test-helpers';
|
||||||
import hbs from 'htmlbars-inline-precompile';
|
import hbs from 'htmlbars-inline-precompile';
|
||||||
|
|
||||||
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
|
|
||||||
import { nonHdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
|
import { nonHdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
|
||||||
|
|
||||||
module('Integration | Component | datasets/containers/data-systems-count', function(hooks) {
|
module('Integration | Component | datasets/containers/data-systems-count', function(hooks) {
|
||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
hooks.beforeEach(function(this: any) {
|
|
||||||
this.server = startMirage();
|
|
||||||
});
|
|
||||||
|
|
||||||
hooks.afterEach(function(this: any) {
|
|
||||||
this.server.shutdown();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('component rendering', async function(assert) {
|
test('component rendering', async function(assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
|
|
||||||
|
@ -16,16 +16,16 @@ module('Integration | Component | datasets/containers/dataset acl access', funct
|
|||||||
this['current-user'] = this.owner.lookup('service:current-user');
|
this['current-user'] = this.owner.lookup('service:current-user');
|
||||||
this.notifications = this.owner.lookup('service:notifications');
|
this.notifications = this.owner.lookup('service:notifications');
|
||||||
|
|
||||||
this.server = sinon.createFakeServer();
|
this.sinonServer = sinon.createFakeServer();
|
||||||
this.server.respondImmediately = true;
|
this.sinonServer.respondImmediately = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
hooks.afterEach(function() {
|
hooks.afterEach(function() {
|
||||||
this.server.restore();
|
this.sinonServer.restore();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('it renders', async function(assert) {
|
test('it renders', async function(assert) {
|
||||||
this.server.respondWith('GET', /\/api\/v2\/datasets.*/, [
|
this.sinonServer.respondWith('GET', /\/api\/v2\/datasets.*/, [
|
||||||
200,
|
200,
|
||||||
{ 'Content-Type': 'application/json' },
|
{ 'Content-Type': 'application/json' },
|
||||||
JSON.stringify({})
|
JSON.stringify({})
|
||||||
|
@ -3,19 +3,10 @@ import { setupRenderingTest } from 'ember-qunit';
|
|||||||
import { render, waitUntil, find } from '@ember/test-helpers';
|
import { render, waitUntil, find } from '@ember/test-helpers';
|
||||||
import hbs from 'htmlbars-inline-precompile';
|
import hbs from 'htmlbars-inline-precompile';
|
||||||
import { initialComplianceObjectFactory } from 'wherehows-web/constants';
|
import { initialComplianceObjectFactory } from 'wherehows-web/constants';
|
||||||
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
|
|
||||||
|
|
||||||
module('Integration | Component | datasets/containers/dataset compliance', function(hooks) {
|
module('Integration | Component | datasets/containers/dataset compliance', function(hooks) {
|
||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
hooks.beforeEach(function() {
|
|
||||||
this.server = startMirage();
|
|
||||||
});
|
|
||||||
|
|
||||||
hooks.afterEach(function() {
|
|
||||||
this.server.shutdown();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('it renders', async function(assert) {
|
test('it renders', async function(assert) {
|
||||||
assert.expect(1);
|
assert.expect(1);
|
||||||
const { server } = this;
|
const { server } = this;
|
||||||
|
@ -2,7 +2,6 @@ import { module, test } from 'qunit';
|
|||||||
import { setupRenderingTest } from 'ember-qunit';
|
import { setupRenderingTest } from 'ember-qunit';
|
||||||
import { render, find, waitFor } from '@ember/test-helpers';
|
import { render, find, waitFor } from '@ember/test-helpers';
|
||||||
import hbs from 'htmlbars-inline-precompile';
|
import hbs from 'htmlbars-inline-precompile';
|
||||||
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
|
|
||||||
import fabrics from 'wherehows-web/mirage/fixtures/fabrics';
|
import fabrics from 'wherehows-web/mirage/fixtures/fabrics';
|
||||||
|
|
||||||
const containerTestClass = 'container-testing-class';
|
const containerTestClass = 'container-testing-class';
|
||||||
@ -10,14 +9,6 @@ const containerTestClass = 'container-testing-class';
|
|||||||
module('Integration | Component | datasets/containers/dataset-fabrics', function(hooks) {
|
module('Integration | Component | datasets/containers/dataset-fabrics', function(hooks) {
|
||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
hooks.beforeEach(function() {
|
|
||||||
this.server = startMirage();
|
|
||||||
});
|
|
||||||
|
|
||||||
hooks.afterEach(function() {
|
|
||||||
this.server.shutdown();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('dataset fabric container rendering', async function(assert) {
|
test('dataset fabric container rendering', async function(assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
|
|
||||||
|
@ -3,11 +3,14 @@ import { setupRenderingTest } from 'ember-qunit';
|
|||||||
import { urn } from 'wherehows-web/mirage/fixtures/urn';
|
import { urn } from 'wherehows-web/mirage/fixtures/urn';
|
||||||
import { render, find } from '@ember/test-helpers';
|
import { render, find } from '@ember/test-helpers';
|
||||||
import hbs from 'htmlbars-inline-precompile';
|
import hbs from 'htmlbars-inline-precompile';
|
||||||
|
import defaultScenario from 'wherehows-web/mirage/scenarios/default';
|
||||||
|
|
||||||
module('Integration | Component | datasets/containers/dataset-health', function(hooks) {
|
module('Integration | Component | datasets/containers/dataset-health', function(hooks) {
|
||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
test('it renders', async function(assert) {
|
test('it renders', async function(assert) {
|
||||||
|
defaultScenario(this.server);
|
||||||
|
|
||||||
this.set('urn', urn);
|
this.set('urn', urn);
|
||||||
await render(hbs`{{datasets/containers/dataset-health urn=urn}}`);
|
await render(hbs`{{datasets/containers/dataset-health urn=urn}}`);
|
||||||
|
|
||||||
|
@ -3,19 +3,10 @@ import { setupRenderingTest } from 'ember-qunit';
|
|||||||
import { render, findAll } from '@ember/test-helpers';
|
import { render, findAll } from '@ember/test-helpers';
|
||||||
import hbs from 'htmlbars-inline-precompile';
|
import hbs from 'htmlbars-inline-precompile';
|
||||||
import { nonHdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
|
import { nonHdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
|
||||||
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
|
|
||||||
|
|
||||||
module('Integration | Component | datasets/containers/dataset-lineage-downstreams', function(hooks) {
|
module('Integration | Component | datasets/containers/dataset-lineage-downstreams', function(hooks) {
|
||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
hooks.beforeEach(function(this: any) {
|
|
||||||
this.server = startMirage();
|
|
||||||
});
|
|
||||||
|
|
||||||
hooks.afterEach(function(this: any) {
|
|
||||||
this.server.shutdown();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('component rendering', async function(assert) {
|
test('component rendering', async function(assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
|
|
||||||
|
@ -2,20 +2,11 @@ import { module, test } from 'qunit';
|
|||||||
import { setupRenderingTest } from 'ember-qunit';
|
import { setupRenderingTest } from 'ember-qunit';
|
||||||
import { render, findAll } from '@ember/test-helpers';
|
import { render, findAll } from '@ember/test-helpers';
|
||||||
import hbs from 'htmlbars-inline-precompile';
|
import hbs from 'htmlbars-inline-precompile';
|
||||||
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
|
|
||||||
import { nonHdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
|
import { nonHdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
|
||||||
|
|
||||||
module('Integration | Component | datasets/containers/dataset-lineage-upstreams', function(hooks) {
|
module('Integration | Component | datasets/containers/dataset-lineage-upstreams', function(hooks) {
|
||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
hooks.beforeEach(function(this: any) {
|
|
||||||
this.server = startMirage();
|
|
||||||
});
|
|
||||||
|
|
||||||
hooks.afterEach(function(this: any) {
|
|
||||||
this.server.shutdown();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('component rendering', async function(assert) {
|
test('component rendering', async function(assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
|
|
||||||
|
@ -9,23 +9,23 @@ module('Integration | Component | datasets/containers/dataset ownership', functi
|
|||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
hooks.beforeEach(function() {
|
hooks.beforeEach(function() {
|
||||||
this.server = sinon.createFakeServer();
|
this.sinonServer = sinon.createFakeServer();
|
||||||
this.server.respondImmediately = true;
|
this.sinonServer.respondImmediately = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
hooks.afterEach(function() {
|
hooks.afterEach(function() {
|
||||||
this.server.restore();
|
this.sinonServer.restore();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('it renders', async function(assert) {
|
test('it renders', async function(assert) {
|
||||||
const lookupClass = '.dataset-owner-table__add-owner';
|
const lookupClass = '.dataset-owner-table__add-owner';
|
||||||
this.set('urn', urn);
|
this.set('urn', urn);
|
||||||
this.server.respondWith('GET', /\/api\/v2\/datasets.*/, [
|
this.sinonServer.respondWith('GET', /\/api\/v2\/datasets.*/, [
|
||||||
200,
|
200,
|
||||||
{ 'Content-Type': 'application/json' },
|
{ 'Content-Type': 'application/json' },
|
||||||
JSON.stringify({})
|
JSON.stringify({})
|
||||||
]);
|
]);
|
||||||
this.server.respondWith('GET', '/api/v1/owner/types', [
|
this.sinonServer.respondWith('GET', '/api/v1/owner/types', [
|
||||||
200,
|
200,
|
||||||
{ 'Content-Type': 'application/json' },
|
{ 'Content-Type': 'application/json' },
|
||||||
JSON.stringify([])
|
JSON.stringify([])
|
||||||
|
@ -2,19 +2,10 @@ import { module, test } from 'qunit';
|
|||||||
import { setupRenderingTest } from 'ember-qunit';
|
import { setupRenderingTest } from 'ember-qunit';
|
||||||
import { render, waitUntil, find } from '@ember/test-helpers';
|
import { render, waitUntil, find } from '@ember/test-helpers';
|
||||||
import hbs from 'htmlbars-inline-precompile';
|
import hbs from 'htmlbars-inline-precompile';
|
||||||
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
|
|
||||||
|
|
||||||
module('Integration | Component | datasets/containers/dataset properties', function(hooks) {
|
module('Integration | Component | datasets/containers/dataset properties', function(hooks) {
|
||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
hooks.beforeEach(function() {
|
|
||||||
this.server = startMirage();
|
|
||||||
});
|
|
||||||
|
|
||||||
hooks.afterEach(function() {
|
|
||||||
this.server.shutdown();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('it renders', async function(assert) {
|
test('it renders', async function(assert) {
|
||||||
const { server } = this;
|
const { server } = this;
|
||||||
const { uri } = server.create('datasetView');
|
const { uri } = server.create('datasetView');
|
||||||
|
@ -3,19 +3,10 @@ import { setupRenderingTest } from 'ember-qunit';
|
|||||||
import { render, find } from '@ember/test-helpers';
|
import { render, find } from '@ember/test-helpers';
|
||||||
import hbs from 'htmlbars-inline-precompile';
|
import hbs from 'htmlbars-inline-precompile';
|
||||||
import { urn } from 'wherehows-web/mirage/fixtures/urn';
|
import { urn } from 'wherehows-web/mirage/fixtures/urn';
|
||||||
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
|
|
||||||
|
|
||||||
module('Integration | Component | datasets/containers/dataset schema', function(hooks) {
|
module('Integration | Component | datasets/containers/dataset schema', function(hooks) {
|
||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
hooks.beforeEach(function() {
|
|
||||||
this.server = startMirage();
|
|
||||||
});
|
|
||||||
|
|
||||||
hooks.afterEach(function() {
|
|
||||||
this.server.shutdown();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('it renders', async function(assert) {
|
test('it renders', async function(assert) {
|
||||||
this.set('urn', urn);
|
this.set('urn', urn);
|
||||||
await render(hbs`{{datasets/containers/dataset-schema urn=urn}}`);
|
await render(hbs`{{datasets/containers/dataset-schema urn=urn}}`);
|
||||||
|
@ -2,11 +2,14 @@ import { module, test } from 'qunit';
|
|||||||
import { setupRenderingTest } from 'ember-qunit';
|
import { setupRenderingTest } from 'ember-qunit';
|
||||||
import { render } from '@ember/test-helpers';
|
import { render } from '@ember/test-helpers';
|
||||||
import hbs from 'htmlbars-inline-precompile';
|
import hbs from 'htmlbars-inline-precompile';
|
||||||
|
import defaultScenario from 'wherehows-web/mirage/scenarios/default';
|
||||||
|
|
||||||
module('Integration | Component | datasets/containers/health-score-gauge', function(hooks) {
|
module('Integration | Component | datasets/containers/health-score-gauge', function(hooks) {
|
||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
test('it renders', async function(assert) {
|
test('it renders', async function(assert) {
|
||||||
|
defaultScenario(this.server);
|
||||||
|
|
||||||
await render(hbs`{{datasets/containers/health-score-gauge}}`);
|
await render(hbs`{{datasets/containers/health-score-gauge}}`);
|
||||||
|
|
||||||
assert.ok(this.element, 'Renders without errors');
|
assert.ok(this.element, 'Renders without errors');
|
||||||
|
@ -2,7 +2,6 @@ import { module, test } from 'qunit';
|
|||||||
import { setupRenderingTest } from 'ember-qunit';
|
import { setupRenderingTest } from 'ember-qunit';
|
||||||
import { render, waitUntil, find, findAll, click } from '@ember/test-helpers';
|
import { render, waitUntil, find, findAll, click } from '@ember/test-helpers';
|
||||||
import hbs from 'htmlbars-inline-precompile';
|
import hbs from 'htmlbars-inline-precompile';
|
||||||
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
|
|
||||||
import { DatasetPlatform, PurgePolicy } from 'wherehows-web/constants';
|
import { DatasetPlatform, PurgePolicy } from 'wherehows-web/constants';
|
||||||
import { hdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
|
import { hdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
|
||||||
|
|
||||||
@ -13,14 +12,6 @@ const purgePolicyClass = '.purge-policy-list__item';
|
|||||||
module('Integration | Component | datasets/containers/upstream dataset', function(hooks) {
|
module('Integration | Component | datasets/containers/upstream dataset', function(hooks) {
|
||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
hooks.beforeEach(function() {
|
|
||||||
this.server = startMirage();
|
|
||||||
});
|
|
||||||
|
|
||||||
hooks.afterEach(function() {
|
|
||||||
this.server.shutdown();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('it renders', async function(assert) {
|
test('it renders', async function(assert) {
|
||||||
assert.expect(1);
|
assert.expect(1);
|
||||||
const { server } = this;
|
const { server } = this;
|
||||||
|
@ -9,12 +9,12 @@ module('Integration | Component | datasets/containers/upstream owners', function
|
|||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
hooks.beforeEach(function() {
|
hooks.beforeEach(function() {
|
||||||
this.server = sinon.createFakeServer();
|
this.sinonServer = sinon.createFakeServer();
|
||||||
this.server.respondImmediately = true;
|
this.sinonServer.respondImmediately = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
hooks.afterEach(function() {
|
hooks.afterEach(function() {
|
||||||
this.server.restore();
|
this.sinonServer.restore();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('it renders', async function(assert) {
|
test('it renders', async function(assert) {
|
||||||
@ -22,7 +22,7 @@ module('Integration | Component | datasets/containers/upstream owners', function
|
|||||||
const nativeName = 'A nativeName';
|
const nativeName = 'A nativeName';
|
||||||
|
|
||||||
this.set('upstreamUrn', hdfsUrn);
|
this.set('upstreamUrn', hdfsUrn);
|
||||||
this.server.respondWith(/\/api\/v2\/datasets.*/, async function(xhr) {
|
this.sinonServer.respondWith(/\/api\/v2\/datasets.*/, async function(xhr) {
|
||||||
xhr.respond(
|
xhr.respond(
|
||||||
200,
|
200,
|
||||||
{ 'Content-Type': 'application/json' },
|
{ 'Content-Type': 'application/json' },
|
||||||
|
@ -3,19 +3,10 @@ import { setupRenderingTest } from 'ember-qunit';
|
|||||||
import { render } from '@ember/test-helpers';
|
import { render } from '@ember/test-helpers';
|
||||||
import hbs from 'htmlbars-inline-precompile';
|
import hbs from 'htmlbars-inline-precompile';
|
||||||
import { nonHdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
|
import { nonHdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
|
||||||
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
|
|
||||||
|
|
||||||
module('Integration | Component | datasets/dataset-relationships', function(hooks) {
|
module('Integration | Component | datasets/dataset-relationships', function(hooks) {
|
||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
hooks.beforeEach(function(this: any) {
|
|
||||||
this.server = startMirage();
|
|
||||||
});
|
|
||||||
|
|
||||||
hooks.afterEach(function(this: any) {
|
|
||||||
this.server.shutdown();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('component rendering', async function(assert) {
|
test('component rendering', async function(assert) {
|
||||||
this.set('urn', nonHdfsUrn);
|
this.set('urn', nonHdfsUrn);
|
||||||
|
|
||||||
|
@ -13,11 +13,11 @@ module('Integration | Component | purge policy', function(hooks) {
|
|||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
hooks.beforeEach(function() {
|
hooks.beforeEach(function() {
|
||||||
this.server = sinon.createFakeServer();
|
this.sinonServer = sinon.createFakeServer();
|
||||||
});
|
});
|
||||||
|
|
||||||
hooks.afterEach(function() {
|
hooks.afterEach(function() {
|
||||||
this.server.restore();
|
this.sinonServer.restore();
|
||||||
});
|
});
|
||||||
|
|
||||||
const policyList = '.purge-policy-list';
|
const policyList = '.purge-policy-list';
|
||||||
@ -89,7 +89,7 @@ module('Integration | Component | purge policy', function(hooks) {
|
|||||||
this.set('purgePolicy', selectedPolicy);
|
this.set('purgePolicy', selectedPolicy);
|
||||||
this.set('supportedPurgePolicies', getSupportedPurgePolicies(platform, platforms));
|
this.set('supportedPurgePolicies', getSupportedPurgePolicies(platform, platforms));
|
||||||
|
|
||||||
this.server.respondWith('GET', '/api/v1/list/platforms', [
|
this.sinonServer.respondWith('GET', '/api/v1/list/platforms', [
|
||||||
200,
|
200,
|
||||||
{ 'Content-Type': 'application/json' },
|
{ 'Content-Type': 'application/json' },
|
||||||
JSON.stringify({ status: ApiStatus.OK, platforms })
|
JSON.stringify({ status: ApiStatus.OK, platforms })
|
||||||
@ -98,7 +98,7 @@ module('Integration | Component | purge policy', function(hooks) {
|
|||||||
await render(
|
await render(
|
||||||
hbs`{{purge-policy isEditable=isEditable purgePolicy=purgePolicy platform=platform supportedPurgePolicies=supportedPurgePolicies}}`
|
hbs`{{purge-policy isEditable=isEditable purgePolicy=purgePolicy platform=platform supportedPurgePolicies=supportedPurgePolicies}}`
|
||||||
);
|
);
|
||||||
this.server.respond();
|
this.sinonServer.respond();
|
||||||
|
|
||||||
assert.ok(
|
assert.ok(
|
||||||
document.querySelector(`${policyList} [type=radio][value=${selectedPolicy}]`).checked,
|
document.querySelector(`${policyList} [type=radio][value=${selectedPolicy}]`).checked,
|
||||||
|
@ -19,16 +19,16 @@ module('Integration | Component | search/containers/search sources', function(ho
|
|||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
hooks.beforeEach(function() {
|
hooks.beforeEach(function() {
|
||||||
this.server = sinon.createFakeServer();
|
this.sinonServer = sinon.createFakeServer();
|
||||||
this.server.respondImmediately = true;
|
this.sinonServer.respondImmediately = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
hooks.afterEach(function() {
|
hooks.afterEach(function() {
|
||||||
this.server.restore();
|
this.sinonServer.restore();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('it renders', async function(assert) {
|
test('it renders', async function(assert) {
|
||||||
this.server.respondWith('GET', /\/api\/v2\/list\/platforms/, [
|
this.sinonServer.respondWith('GET', /\/api\/v2\/list\/platforms/, [
|
||||||
200,
|
200,
|
||||||
{ 'Content-Type': 'application/json' },
|
{ 'Content-Type': 'application/json' },
|
||||||
JSON.stringify(platformsResponse)
|
JSON.stringify(platformsResponse)
|
||||||
@ -46,7 +46,7 @@ module('Integration | Component | search/containers/search sources', function(ho
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Platform sources yielded', async function(assert) {
|
test('Platform sources yielded', async function(assert) {
|
||||||
this.server.respondWith('GET', /\/api\/v2\/list\/platforms/, [
|
this.sinonServer.respondWith('GET', /\/api\/v2\/list\/platforms/, [
|
||||||
200,
|
200,
|
||||||
{ 'Content-Type': 'application/json' },
|
{ 'Content-Type': 'application/json' },
|
||||||
JSON.stringify(platformsResponse)
|
JSON.stringify(platformsResponse)
|
||||||
@ -57,7 +57,7 @@ module('Integration | Component | search/containers/search sources', function(ho
|
|||||||
<span class="inner-content">
|
<span class="inner-content">
|
||||||
{{#each container.radioSources as |source|}}
|
{{#each container.radioSources as |source|}}
|
||||||
{{source.value}}
|
{{source.value}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</span>
|
</span>
|
||||||
{{/search/containers/search-sources}}
|
{{/search/containers/search-sources}}
|
||||||
`);
|
`);
|
||||||
|
@ -5,11 +5,11 @@ import { ApiStatus } from 'wherehows-web/utils/api';
|
|||||||
|
|
||||||
module('Unit | Utility | authenticators/custom ldap', function(hooks) {
|
module('Unit | Utility | authenticators/custom ldap', function(hooks) {
|
||||||
hooks.beforeEach(function() {
|
hooks.beforeEach(function() {
|
||||||
this.server = sinon.createFakeServer();
|
this.sinonServer = sinon.createFakeServer();
|
||||||
});
|
});
|
||||||
|
|
||||||
hooks.afterEach(function() {
|
hooks.afterEach(function() {
|
||||||
this.server.restore();
|
this.sinonServer.restore();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Authenticate methods work as expected', async function(assert) {
|
test('Authenticate methods work as expected', async function(assert) {
|
||||||
@ -23,14 +23,14 @@ module('Unit | Utility | authenticators/custom ldap', function(hooks) {
|
|||||||
|
|
||||||
let response;
|
let response;
|
||||||
|
|
||||||
this.server.respondWith('POST', '/authenticate', [
|
this.sinonServer.respondWith('POST', '/authenticate', [
|
||||||
200,
|
200,
|
||||||
{ 'Content-Type': 'application/json' },
|
{ 'Content-Type': 'application/json' },
|
||||||
JSON.stringify({ status: ApiStatus.OK, data })
|
JSON.stringify({ status: ApiStatus.OK, data })
|
||||||
]);
|
]);
|
||||||
|
|
||||||
response = authenticator.authenticate('username', 'password');
|
response = authenticator.authenticate('username', 'password');
|
||||||
this.server.respond();
|
this.sinonServer.respond();
|
||||||
|
|
||||||
assert.ok(typeof response.then === 'function', 'returns a Promise object or thennable');
|
assert.ok(typeof response.then === 'function', 'returns a Promise object or thennable');
|
||||||
assert.equal((await response).username, data.username, 'authenticate correctly resolves with api response');
|
assert.equal((await response).username, data.username, 'authenticate correctly resolves with api response');
|
||||||
|
@ -2,6 +2,7 @@ import { module, test } from 'qunit';
|
|||||||
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
|
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
|
||||||
import datasetsCreateSearchEntries from 'wherehows-web/utils/datasets/create-search-entries';
|
import datasetsCreateSearchEntries from 'wherehows-web/utils/datasets/create-search-entries';
|
||||||
import { testSchemaA } from 'wherehows-web/mirage/fixtures/schema';
|
import { testSchemaA } from 'wherehows-web/mirage/fixtures/schema';
|
||||||
|
import mirageScenario from 'wherehows-web/mirage/scenarios/default';
|
||||||
|
|
||||||
module('Unit | Utility | datasets/create search entries', function(hooks) {
|
module('Unit | Utility | datasets/create search entries', function(hooks) {
|
||||||
hooks.beforeEach(function() {
|
hooks.beforeEach(function() {
|
||||||
@ -14,7 +15,7 @@ module('Unit | Utility | datasets/create search entries', function(hooks) {
|
|||||||
|
|
||||||
test('it works base case', function(assert) {
|
test('it works base case', function(assert) {
|
||||||
const { server } = this;
|
const { server } = this;
|
||||||
const dataset = server.create('dataset', 'forUnitTests');
|
const dataset = server.create('dataset', 'forUnitTests').attrs;
|
||||||
|
|
||||||
const result = datasetsCreateSearchEntries([]);
|
const result = datasetsCreateSearchEntries([]);
|
||||||
assert.ok(!result, 'Returns without error for nothing case');
|
assert.ok(!result, 'Returns without error for nothing case');
|
||||||
@ -26,7 +27,7 @@ module('Unit | Utility | datasets/create search entries', function(hooks) {
|
|||||||
|
|
||||||
test('it works for keyword cases', function(assert) {
|
test('it works for keyword cases', function(assert) {
|
||||||
const { server } = this;
|
const { server } = this;
|
||||||
const dataset = server.create('dataset', 'forUnitTests');
|
const dataset = server.create('dataset', 'forUnitTests').attrs;
|
||||||
|
|
||||||
datasetsCreateSearchEntries([dataset], 'Rebel');
|
datasetsCreateSearchEntries([dataset], 'Rebel');
|
||||||
assert.equal(dataset.id, 0, 'Sanity check: Created model successfully again');
|
assert.equal(dataset.id, 0, 'Sanity check: Created model successfully again');
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user