Skip to content

Commit

Permalink
CB-4691 updates tests for new export setting
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyteleshev committed Jul 1, 2024
1 parent 0227482 commit a862388
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,14 @@ const testValueNew = false;

const deprecatedSettings = {
'core.app.dataViewer.disableEdit': testValueDeprecated,
'plugin.data-export.disabled': testValueDeprecated,
'plugin.data-viewer.disabled': testValueDeprecated,
'plugin_data_export.disabled': testValueDeprecated,
};

const newSettings = {
...deprecatedSettings,
'plugin.data-viewer.disableEdit': testValueNew,
'plugin.data-viewer.export.disabled': testValueNew,
};

async function setupSettingsService(mockConfig: any = {}) {
Expand All @@ -100,13 +102,17 @@ test('New settings override deprecated settings', async () => {
const settingsService = await setupSettingsService(newSettings);

expect(settingsService.disableEdit).toBe(testValueNew);
expect(settingsService.disableExportData).toBe(testValueNew);

expectNoDeprecatedSettingMessage();
});

test('Deprecated settings are used if new settings are not defined', async () => {
const settingsService = await setupSettingsService(deprecatedSettings);

expect(settingsService.disableEdit).toBe(testValueDeprecated);
expect(settingsService.disableExportData).toBe(testValueDeprecated);

expectDeprecatedSettingMessage();
});

Expand Down

0 comments on commit a862388

Please sign in to comment.