mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-11 17:17:01 +02:00
* staying with jsondiff * routing setup * send compare against data to component after using new adapater method to return the version data. * functionality * fix issue on route transition not calling model hook * formatting * update version * changelog * glimmerize the json-editor component * catch up * passing tracked property from child to parent * pull out of jsonEditor * fix issue with message * icon * fix some issues with right selection * changes and convert to component * integration test * tests * fixes * cleanup * cleanup 2 * fixes * fix test by spread attributes * remove log * remove
39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
import EmberObject from '@ember/object';
|
|
import { module, test } from 'qunit';
|
|
import { setupRenderingTest } from 'ember-qunit';
|
|
import { render, click, settled } from '@ember/test-helpers';
|
|
import { hbs } from 'ember-cli-htmlbars';
|
|
|
|
const VERSIONS = [
|
|
{
|
|
version: 2,
|
|
},
|
|
{
|
|
version: 1,
|
|
},
|
|
];
|
|
|
|
module('Integration | Component | diff-version-selector', function(hooks) {
|
|
setupRenderingTest(hooks);
|
|
|
|
test('it renders', async function(assert) {
|
|
this.set(
|
|
'model',
|
|
EmberObject.create({
|
|
currentVersion: 2,
|
|
versions: VERSIONS,
|
|
})
|
|
);
|
|
await render(hbs`<DiffVersionSelector @model={{this.model}} />`);
|
|
let leftSideVersion = document
|
|
.querySelector('[data-test-popup-menu-trigger="left-version"]')
|
|
.innerText.trim();
|
|
assert.equal(leftSideVersion, 'Version 2', 'left side toolbar defaults to currentVersion');
|
|
|
|
await click('[data-test-popup-menu-trigger="left-version"]');
|
|
await settled();
|
|
assert.dom('[data-test-leftSide-version="1"]').exists('leftside shows both versions');
|
|
assert.dom('[data-test-leftSide-version="2"]').exists('leftside shows both versions');
|
|
});
|
|
});
|