-
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.
Browse files
Browse the repository at this point in the history
* fixes issue restoring raft snapshot * adds changelog entry
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:bug | ||
ui: Fixes issue restoring raft storage snapshot | ||
``` |
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
31 changes: 31 additions & 0 deletions
31
ui/tests/integration/components/raft-storage-restore-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,31 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { setupMirage } from 'ember-cli-mirage/test-support'; | ||
import { render, triggerEvent, click } from '@ember/test-helpers'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
|
||
module('Integration | Component | raft-storage-restore', function(hooks) { | ||
setupRenderingTest(hooks); | ||
setupMirage(hooks); | ||
|
||
test('it should restore snapshot', async function(assert) { | ||
assert.expect(2); | ||
|
||
this.server.post('/sys/storage/raft/snapshot', () => { | ||
assert.ok(true, 'Request made to restore snapshot'); | ||
return; | ||
}); | ||
this.server.post('/sys/storage/raft/snapshot-force', () => { | ||
assert.ok(true, 'Request made to force restore snapshot'); | ||
return; | ||
}); | ||
|
||
await render(hbs`<RaftStorageRestore />`); | ||
await triggerEvent('[data-test-file-input]', 'change', { | ||
files: [new Blob(['Raft Snapshot'])], | ||
}); | ||
await click('[data-test-edit-form-submit]'); | ||
await click('#force-restore'); | ||
await click('[data-test-edit-form-submit]'); | ||
}); | ||
}); |