mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
UI console (#4631)
* adding columnify and ember-cli-cjs-transform * add yargs-parser * remove vendored yargs-parser tokenizer and use cjs transform to import it from actual yargs-parser * add clear command that clears the log, but maintains history * make codemirror have no gutter and be auto-height when rendered in the console output log * add fullscreen command and hook up fullscreen toggle button * hook up copy button
This commit is contained in:
24
ui/tests/integration/components/console/log-json-test.js
Normal file
24
ui/tests/integration/components/console/log-json-test.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { moduleForComponent, test } from 'ember-qunit';
|
||||
import hbs from 'htmlbars-inline-precompile';
|
||||
|
||||
moduleForComponent('console/log-json', 'Integration | Component | console/log json', {
|
||||
integration: true,
|
||||
|
||||
beforeEach() {
|
||||
this.inject.service('code-mirror', { as: 'codeMirror' });
|
||||
},
|
||||
});
|
||||
|
||||
test('it renders', function(assert) {
|
||||
// Set any properties with this.set('myProperty', 'value');
|
||||
// Handle any actions with this.on('myAction', function(val) { ... });
|
||||
const objectContent = { one: 'two', three: 'four', seven: { five: 'six' }, eight: [5, 6] };
|
||||
const expectedText = JSON.stringify(objectContent, null, 2);
|
||||
|
||||
this.set('content', objectContent);
|
||||
|
||||
this.render(hbs`{{console/log-json content=content}}`);
|
||||
const instance = this.codeMirror.instanceFor(this.$('[data-test-component=json-editor]').attr('id'));
|
||||
|
||||
assert.equal(instance.getValue(), expectedText);
|
||||
});
|
Reference in New Issue
Block a user