* [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>
46 lines
1.4 KiB
JavaScript
46 lines
1.4 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
import { module, test } from 'qunit';
|
|
import { setupTest } from 'ember-qunit';
|
|
|
|
module('Unit | Model | credential store', function (hooks) {
|
|
setupTest(hooks);
|
|
|
|
test('it exists', function (assert) {
|
|
let store = this.owner.lookup('service:store');
|
|
let model = store.createRecord('credential-store', {});
|
|
assert.ok(model);
|
|
});
|
|
|
|
test('it has a `isStatic` computed property and returns the expected values', async function (assert) {
|
|
assert.expect(3);
|
|
const store = this.owner.lookup('service:store');
|
|
const modelStatic = store.createRecord('credential-store', {
|
|
type: 'static',
|
|
});
|
|
const modelVault = store.createRecord('credential-store', {
|
|
type: 'vault',
|
|
});
|
|
assert.strictEqual(typeof modelStatic.isStatic, 'boolean');
|
|
assert.true(modelStatic.isStatic);
|
|
assert.false(modelVault.isStatic);
|
|
});
|
|
|
|
test('it has a `isVault` computed property and returns the expected values', async function (assert) {
|
|
assert.expect(3);
|
|
const store = this.owner.lookup('service:store');
|
|
const modelVault = store.createRecord('credential-store', {
|
|
type: 'vault',
|
|
});
|
|
const modelStatic = store.createRecord('credential-store', {
|
|
type: 'static',
|
|
});
|
|
assert.strictEqual(typeof modelVault.isVault, 'boolean');
|
|
assert.true(modelVault.isVault);
|
|
assert.false(modelStatic.isVault);
|
|
});
|
|
});
|