-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* serialize instead of toJSON when mount tuning * add tests * remove model unit test * fix typo
- Loading branch information
1 parent
d4bcb38
commit f4a908b
Showing
6 changed files
with
66 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
ui/tests/integration/components/auth-config-form/options-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { moduleForComponent, test } from 'ember-qunit'; | ||
import Ember from 'ember'; | ||
import wait from 'ember-test-helpers/wait'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
import sinon from 'sinon'; | ||
|
||
import { create } from 'ember-cli-page-object'; | ||
import authConfigForm from 'vault/tests/pages/components/auth-config-form/options'; | ||
|
||
const component = create(authConfigForm); | ||
|
||
moduleForComponent('auth-config-form/options', 'Integration | Component | auth-config-form options', { | ||
integration: true, | ||
beforeEach() { | ||
Ember.getOwner(this).lookup('service:flash-messages').registerTypes(['success']); | ||
component.setContext(this); | ||
}, | ||
|
||
afterEach() { | ||
component.removeContext(); | ||
}, | ||
}); | ||
|
||
test('it submits data correctly', function(assert) { | ||
let model = Ember.Object.create({ | ||
tune() { | ||
return Ember.RSVP.resolve(); | ||
}, | ||
config: { | ||
serialize() { | ||
return {}; | ||
}, | ||
}, | ||
}); | ||
sinon.spy(model.config, 'serialize'); | ||
this.set('model', model); | ||
this.render(hbs`{{auth-config-form/options model=model}}`); | ||
component.save(); | ||
wait().then(() => { | ||
assert.ok(model.config.serialize.calledOnce); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { clickable, fillable } from 'ember-cli-page-object'; | ||
|
||
import fields from '../form-field'; | ||
export default { | ||
...fields, | ||
ttlValue: fillable('[data-test-ttl-value]'), | ||
ttlUnit: fillable('[data-test-ttl-value]'), | ||
save: clickable('[data-test-save-config]'), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters