2019-08-31 20:51:14 -07:00
|
|
|
import { module, test } from 'qunit';
|
|
|
|
import { refreshModelForQueryParams } from '@datahub/utils/routes/refresh-model-for-query-params';
|
|
|
|
|
|
|
|
module('Unit | Utility | route/refresh-model-for-query-params', function() {
|
2020-08-26 15:44:50 -07:00
|
|
|
test('it returns the expected object for a list of query params', function(assert): void {
|
2019-08-31 20:51:14 -07:00
|
|
|
const testParams = ['name', 'type', 'moveset'];
|
|
|
|
const result = refreshModelForQueryParams(testParams);
|
|
|
|
|
|
|
|
assert.ok(result, 'Function runs without errors');
|
|
|
|
assert.equal(result.name.refreshModel, true, 'Correctly creates proper object interface');
|
|
|
|
|
|
|
|
assert.equal(result.moveset.refreshModel, true, 'Correctly creates interface for multiple properties');
|
|
|
|
});
|
|
|
|
});
|