Skip to content

Commit

Permalink
fix: reset the selected tool to zoom when switching between spectra o…
Browse files Browse the repository at this point in the history
…r nuclei

test: select the exclusion zone tool after selecting another spectrum in exclusion zones test
  • Loading branch information
hamed-musallam committed Jun 26, 2023
1 parent dded4f4 commit eee03ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/component/reducer/actions/SpectrumsActions.ts
Expand Up @@ -25,7 +25,6 @@ import {
} from '../../../data/data2d/Spectrum2D';
import { contoursManager } from '../../../data/data2d/Spectrum2D/contours';
import { Nuclei, Nucleus } from '../../../data/types/common/Nucleus';
import { options } from '../../toolbar/ToolTypes';
import groupByInfoKey from '../../utility/GroupByInfoKey';
import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
import { State } from '../Reducer';
Expand Down Expand Up @@ -396,10 +395,7 @@ function handleChangeActiveSpectrum(
setMode(draft);
}

if (
options[toolOptions.selectedTool].isFilter &&
!toolOptions.data.activeFilterID
) {
if (!toolOptions.data.activeFilterID) {
resetSelectedTool(draft);
}
}
Expand Down
3 changes: 3 additions & 0 deletions test-e2e/panels/filters.test.ts
Expand Up @@ -264,6 +264,9 @@ test('Exclusion zones', async ({ page }) => {
});

await test.step('add exclusion zones to the active spectrum', async () => {
//select exclusion zones tool
await nmrium.clickTool('exclusionZones');

//add exclusion zones to the last spectrum which is active from the previous step
await selectRange(nmrium, { axis: 'X', startX: 200, endX: 220 });

Expand Down

0 comments on commit eee03ca

Please sign in to comment.