expect(exclusiveLocks.checked).toBe(true);
expect(exclusiveLocks.disabled).toBe(true);
});
+
+ it('should have journaling feature for journaling mirror mode on createRequest', () => {
+ component.mirroring = true;
+ fixture.detectChanges();
+ const journal = fixture.debugElement.query(By.css('#journal')).nativeElement;
+ expect(journal.checked).toBe(true);
+ const request = component.createRequest();
+ expect(request.features).toContain('journaling');
+ });
+
+ it('should have journaling feature for journaling mirror mode on editRequest', () => {
+ component.mirroring = true;
+ fixture.detectChanges();
+ const journal = fixture.debugElement.query(By.css('#journal')).nativeElement;
+ expect(journal.checked).toBe(true);
+ const request = component.editRequest();
+ expect(request.features).toContain('journaling');
+ });
});
});
});
}
});
request.enable_mirror = this.rbdForm.getValue('mirroring');
- if (this.poolMirrorMode === 'image') {
- if (request.enable_mirror) {
+ if (request.enable_mirror) {
+ if (this.rbdForm.getValue('mirroringMode') === 'journal') {
+ request.features.push('journaling');
+ }
+ if (this.poolMirrorMode === 'image') {
request.mirror_mode = this.rbdForm.getValue('mirroringMode');
}
} else {
- if (request.enable_mirror) {
- request.features.push('journaling');
- } else {
- const index = request.features.indexOf('journaling', 0);
- if (index > -1) {
- request.features.splice(index, 1);
- }
+ const index = request.features.indexOf('journaling', 0);
+ if (index > -1) {
+ request.features.splice(index, 1);
}
}
request.configuration = this.getDirtyConfigurationValues();
actionPrimary(primary: boolean) {
const request = new RbdFormEditRequestModel();
request.primary = primary;
+ request.features = null;
const imageSpec = new ImageSpec(
this.selection.first().pool_name,
this.selection.first().namespace,