* [COMPLIANCE] Add Copyright and License Headers * chore: 🤖 update Copyright headers to satisfy our lint rules --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Co-authored-by: Cameron Perera <cameron.perera@hashicorp.com>
33 lines
978 B
JavaScript
33 lines
978 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
import { module, test } from 'qunit';
|
|
import { setupTest } from 'ember-qunit';
|
|
import { TYPE_CREDENTIAL_LIBRARY_VAULT_GENERIC } from 'api/models/credential-library';
|
|
|
|
module('Unit | Model | credential library', function (hooks) {
|
|
setupTest(hooks);
|
|
|
|
test('it exists', function (assert) {
|
|
let store = this.owner.lookup('service:store');
|
|
let model = store.createRecord('credential-library', {});
|
|
assert.ok(model);
|
|
});
|
|
|
|
test('it has isUnknown property and returns the expected values', async function (assert) {
|
|
assert.expect(2);
|
|
const store = this.owner.lookup('service:store');
|
|
const modelA = store.createRecord('credential-library', {
|
|
type: TYPE_CREDENTIAL_LIBRARY_VAULT_GENERIC,
|
|
});
|
|
const modelB = store.createRecord('credential-library', {
|
|
type: 'unknown',
|
|
});
|
|
|
|
assert.false(modelA.isUnknown);
|
|
assert.true(modelB.isUnknown);
|
|
});
|
|
});
|