Files
threshold-ui/addons/api/tests/unit/models/credential-library-test.js
T
Carlos Alcaide Corvo b51c8203ee chore: 🤖 Upgrade eslint-plugin-qunit (#2011)
* chore: 🤖 Upgrade eslint-plugin-qunit

* Delete unnecessary assert.expect from tests
2023-12-08 12:56:00 -08:00

32 lines
956 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) {
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);
});
});