open-vault/ui/tests/unit/models/secret-v2-version-test.js
Hamid Ghaf 27bb03bbc0
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00

39 lines
1,000 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import { run } from '@ember/runloop';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Model | secret-v2-version', function (hooks) {
setupTest(hooks);
test('deleted is true for a past deletionTime', function (assert) {
assert.expect(1);
let model;
run(() => {
model = run(() =>
this.owner.lookup('service:store').createRecord('secret-v2-version', {
deletionTime: '2000-10-14T00:00:00.000000Z',
})
);
assert.true(model.get('deleted'));
});
});
test('deleted is false for a future deletionTime', function (assert) {
assert.expect(1);
let model;
run(() => {
model = run(() =>
this.owner.lookup('service:store').createRecord('secret-v2-version', {
deletionTime: '2999-10-14T00:00:00.000000Z',
})
);
assert.false(model.get('deleted'));
});
});
});