open-vault/ui/tests/unit/models/secret-engine-test.js
Matthew Irish d509588cd2
Ember update (#5386)
Ember update - update ember-cli, ember-data, and ember to 3.4 series
2018-09-25 11:28:26 -05:00

42 lines
1.1 KiB
JavaScript

import { run } from '@ember/runloop';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Model | secret-engine', function(hooks) {
setupTest(hooks);
test('modelTypeForKV is secret by default', function(assert) {
let model;
run(() => {
model = run(() => this.owner.lookup('service:store').createRecord('secret-engine'));
assert.equal(model.get('modelTypeForKV'), 'secret');
});
});
test('modelTypeForKV is secret-v2 for kv v2', function(assert) {
let model;
run(() => {
model = run(() =>
this.owner.lookup('service:store').createRecord('secret-engine', {
options: { version: 2 },
type: 'kv',
})
);
assert.equal(model.get('modelTypeForKV'), 'secret-v2');
});
});
test('modelTypeForKV is secret-v2 for generic v2', function(assert) {
let model;
run(() => {
model = run(() =>
this.owner.lookup('service:store').createRecord('secret-engine', {
options: { version: 2 },
type: 'kv',
})
);
assert.equal(model.get('modelTypeForKV'), 'secret-v2');
});
});
});