Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
meirish committed Jul 13, 2018
1 parent 3c18b74 commit 5a66937
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions ui/tests/integration/components/secret-edit-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('secret-edit', 'Integration | Component | secret edit', {
integration: true,
});

test('it disables JSON toggle in show mode when is an advanced format', function(assert) {
this.set('mode', 'show');
this.set('key', {
secretData: {
int: 2,
null: null,
float: 1.234,
},
});

this.render(hbs`{{secret-edit mode=mode key=key }}`);
assert.dom('[data-test-secret-json-toggle]').isDisabled();
});

test('it does JSON toggle in show mode when is', function(assert) {
this.set('mode', 'show');
this.set('key', {
secretData: {
int: '2',
null: 'null',
float: '1.234',
},
});

this.render(hbs`{{secret-edit mode=mode key=key }}`);
assert.dom('[data-test-secret-json-toggle]').isNotDisabled();
});

0 comments on commit 5a66937

Please # to comment.