/** * Copyright (c) HashiCorp, Inc. * SPDX-License-Identifier: BUSL-1.1 */ import { module, test } from 'qunit'; import sinon from 'sinon'; import EmberObject from '@ember/object'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import timestamp from 'core/utils/timestamp'; module('Integration | Component | keymgmt/key-edit', function (hooks) { setupRenderingTest(hooks); hooks.before(function () { sinon.stub(timestamp, 'now').callsFake(() => new Date('2018-04-03T14:15:30')); }); hooks.beforeEach(function () { const now = timestamp.now(); const model = EmberObject.create({ name: 'Unicorns', id: 'Unicorns', minEnabledVersion: 1, versions: [ { id: 1, creation_time: now.toString(), }, { id: 2, creation_time: now.toString(), }, ], canDelete: true, }); this.model = model; this.tab = ''; }); hooks.after(function () { timestamp.now.restore(); }); // TODO: Add capabilities tests test('it renders show view as default', async function (assert) { assert.expect(8); await render( hbs`