Enabled auto reset state for action buttons

no issue

- By default, action buttons had auto-reset off and reset had to be explicitly set
- Auto reset for action buttons is on by default now, and any button that should not reset should explicitly switch it off
This commit is contained in:
Rish 2020-06-04 11:30:30 +05:30 committed by Rishabh Garg
parent 0e8b66018e
commit 36fa9dc32c
2 changed files with 11 additions and 6 deletions

View File

@ -35,7 +35,7 @@ const GhTaskButton = Component.extend({
idleClass: '',
runningClass: '',
showSuccess: true, // set to false if you want the spinner to show until a transition occurs
autoReset: false, // set to false if you want don't want task button to reset after timeout
autoReset: true, // set to false if you want don't want task button to reset after timeout
successText: 'Saved',
successClass: 'gh-btn-green',
failureText: 'Retry',

View File

@ -522,7 +522,12 @@ describe('Acceptance: Staff', function () {
// Save changes
await click('[data-test-save-button]');
expect(find('[data-test-save-button]').textContent.trim(), 'save button text').to.equal('Saved');
// Since we reset save status so there's no on-screen indication
// that we've had a save, check the request was fired instead
let [lastRequest] = this.server.pretender.handledRequests.slice(-1);
let params = JSON.parse(lastRequest.requestBody);
expect(params.users[0].name).to.equal('Test User');
// CMD-S shortcut works
await fillIn('[data-test-slug-input]', 'Test User');
@ -532,10 +537,10 @@ describe('Acceptance: Staff', function () {
ctrlKey: ctrlOrCmd === 'ctrl'
});
// we've already saved in this test so there's no on-screen indication
// that we've had another save, check the request was fired instead
let [lastRequest] = this.server.pretender.handledRequests.slice(-1);
let params = JSON.parse(lastRequest.requestBody);
// Since we reset save status so there's no on-screen indication
// that we've had a save, check the request was fired instead
[lastRequest] = this.server.pretender.handledRequests.slice(-1);
params = JSON.parse(lastRequest.requestBody);
expect(params.users[0].name).to.equal('Test User');