mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-21 15:48:05 +00:00

upgrades various dependencies. renames mirage .js files to .ts. fixes linting issues. rebuilds lock file removes redux deps upgrades to latest Revert "upgrades to latest" This reverts commit 45d2d45b0a28db3217863b2ac9492c5bfe67bf0a. Committer: Seyi Adebajo <sadebajo@linkedin.com> reoders tsconfig keys
35 lines
1.3 KiB
JavaScript
35 lines
1.3 KiB
JavaScript
import { module, test } from 'qunit';
|
|
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
|
|
import datasetsCreateSearchEntries from 'wherehows-web/utils/datasets/create-search-entries';
|
|
import { testSchemaA } from 'wherehows-web/mirage/fixtures/schema';
|
|
|
|
module('Unit | Utility | datasets/create search entries', {
|
|
beforeEach() {
|
|
this.server = startMirage();
|
|
},
|
|
afterEach() {
|
|
this.server.shutdown();
|
|
}
|
|
});
|
|
|
|
test('it works base case', function(assert) {
|
|
const { server } = this;
|
|
const dataset = server.create('dataset', 'forUnitTests');
|
|
|
|
const result = datasetsCreateSearchEntries([]);
|
|
assert.ok(!result, 'Returns without error for nothing case');
|
|
|
|
datasetsCreateSearchEntries([dataset]);
|
|
assert.equal(dataset.id, 0, 'Sanity check: Created model successfully');
|
|
assert.equal(dataset.schema, testSchemaA.slice(0, 499), 'Partial schema from beginning if no keyword found');
|
|
});
|
|
|
|
test('it works for keyword cases', function(assert) {
|
|
const { server } = this;
|
|
const dataset = server.create('dataset', 'forUnitTests');
|
|
|
|
datasetsCreateSearchEntries([dataset], 'Rebel');
|
|
assert.equal(dataset.id, 0, 'Sanity check: Created model successfully again');
|
|
assert.equal(dataset.schema, testSchemaA.slice(29, 529), 'Partial schema starts from keyword index');
|
|
});
|