Replace time element with Hds::Time component (#3112)
* refactor: 💡 use Hds::Time component * refactor: 💡 fix data test selector * refactor: 💡 standardardized date/time format * refactor: 💡 fix tests and remove date helpers * fix: 🐛 fixed helper test import
This commit is contained in:
1 parent
1e49283a33
commit
1780077068
19 files changed
+85
-169
No files matched your search
@@ -9,10 +9,9 @@ import {
|
||||
TYPE_CREDENTIAL_JSON,
|
||||
TYPE_CREDENTIAL_SSH_PRIVATE_KEY,
|
||||
TYPE_CREDENTIAL_USERNAME_PASSWORD_DOMAIN,
|
||||
TYPE_CREDENTIAL_USERNAME_PASSWORD
|
||||
TYPE_CREDENTIAL_USERNAME_PASSWORD,
|
||||
} from 'api/models/credential';
|
||||
|
||||
|
||||
module('Unit | Model | credential', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
@@ -35,7 +34,9 @@ module('Unit | Model | credential', function (hooks) {
|
||||
|
||||
test('it has isJSON property and returns the expected values', async function (assert) {
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('credential', { type: TYPE_CREDENTIAL_JSON });
|
||||
const modelA = store.createRecord('credential', {
|
||||
type: TYPE_CREDENTIAL_JSON,
|
||||
});
|
||||
const modelB = store.createRecord('credential', {
|
||||
type: TYPE_CREDENTIAL_USERNAME_PASSWORD,
|
||||
});
|
||||
@@ -51,13 +52,15 @@ module('Unit | Model | credential', function (hooks) {
|
||||
test('it has isUnknown property and returns the expected values', async function (assert) {
|
||||
const store = this.owner.lookup('service:store');
|
||||
const modelA = store.createRecord('credential', {
|
||||
type: TYPE_CREDENTIAL_USERNAME_PASSWORD
|
||||
type: TYPE_CREDENTIAL_USERNAME_PASSWORD,
|
||||
});
|
||||
const modelB = store.createRecord('credential', {
|
||||
type: TYPE_CREDENTIAL_SSH_PRIVATE_KEY
|
||||
type: TYPE_CREDENTIAL_SSH_PRIVATE_KEY,
|
||||
});
|
||||
const modelC = store.createRecord('credential', { type: 'unknown' });
|
||||
const modelD = store.createRecord('credential', { type: TYPE_CREDENTIAL_USERNAME_PASSWORD_DOMAIN });
|
||||
const modelD = store.createRecord('credential', {
|
||||
type: TYPE_CREDENTIAL_USERNAME_PASSWORD_DOMAIN,
|
||||
});
|
||||
|
||||
assert.false(modelA.isUnknown);
|
||||
assert.false(modelB.isUnknown);
|
||||
|
||||
@@ -70,7 +70,8 @@ module('Unit | Utility | sqlite-query', function (hooks) {
|
||||
{ field: 'name', alias: 'resource_name' },
|
||||
{ field: 'type', alias: 'resource_type' },
|
||||
],
|
||||
expectedSelect: '"target".name as resource_name, "target".type as resource_type',
|
||||
expectedSelect:
|
||||
'"target".name as resource_name, "target".type as resource_type',
|
||||
},
|
||||
'count with alias': {
|
||||
select: [{ field: 'id', isCount: true, alias: 'total_count' }],
|
||||
@@ -118,7 +119,8 @@ module('Unit | Utility | sqlite-query', function (hooks) {
|
||||
{ field: 'type', isDistinct: true, isCount: true },
|
||||
{ field: 'status', isDistinct: true, isCount: true },
|
||||
],
|
||||
expectedSelect: 'count(DISTINCT "target".type), count(DISTINCT "target".status)',
|
||||
expectedSelect:
|
||||
'count(DISTINCT "target".type), count(DISTINCT "target".status)',
|
||||
},
|
||||
'distinct with alias': {
|
||||
select: [{ field: 'type', isDistinct: true, alias: 'unique_type' }],
|
||||
@@ -129,7 +131,8 @@ module('Unit | Utility | sqlite-query', function (hooks) {
|
||||
{ field: 'type', isDistinct: true, alias: 'unique_type' },
|
||||
{ field: 'status', isDistinct: true, alias: 'unique_status' },
|
||||
],
|
||||
expectedSelect: 'DISTINCT "target".type as unique_type, "target".status as unique_status',
|
||||
expectedSelect:
|
||||
'DISTINCT "target".type as unique_type, "target".status as unique_status',
|
||||
},
|
||||
'count distinct multiple fields': {
|
||||
select: [
|
||||
|
||||
Reference in new issue
Block a user