mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 17:52:32 +00:00
Raft Snapshot Restore Bug (#13107)
* fixes issue restoring raft snapshot * adds changelog entry
This commit is contained in:
3
changelog/13107.txt
Normal file
3
changelog/13107.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
ui: Fixes issue restoring raft storage snapshot
|
||||
```
|
||||
@@ -5,6 +5,7 @@ import { assign } from '@ember/polyfills';
|
||||
import { set } from '@ember/object';
|
||||
import RSVP from 'rsvp';
|
||||
import config from '../config/environment';
|
||||
import fetch from 'fetch';
|
||||
|
||||
const { APP } = config;
|
||||
const { POLLING_URLS, NAMESPACE_ROOT_URLS } = APP;
|
||||
|
||||
31
ui/tests/integration/components/raft-storage-restore-test.js
Normal file
31
ui/tests/integration/components/raft-storage-restore-test.js
Normal file
@@ -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]');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user