Added unit tests to check the tof mode is changed correctly when:
switching from stack with no spectra file to stack with spectra file
switching from stack with spectra file to stack with spectra file (for tof modes ToFUnitMode.WAVELENGTH, ToFUnitMode.ENERGY, ToFUnitMode.TOF_US)
switching from stack with no spectra file to stack with no spectra file
switching from stack with spectra file to stack with no spectra file
These tests check that the tof mode is changed as expected but also if the right click units menu has the correct behaviour (i.e. disabling when there is no spectra file and enabling when there is a spectrum file).
A test has also been added to check that when there is no stack available in the spectrum viewer (i.e. it has been deleted in the Main Window), then the tof mode and right click menu behaves appropriately.
coverage: 73.176% (+0.2%) from 72.992%
when pulling 99d426a4d3440cb6a0ba7a2e268eb66816d0a747 on 2213-spectrum-viewer-stack-units-tests
into f0433e57e2d08e1c771306299f1aa9b288a0caca on main.
coverage: 73.229% (+0.2%) from 72.992%
when pulling fbc701d7b45d7924e198e020bcdb78dc581a70d7 on 2213-spectrum-viewer-stack-units-tests
into f0433e57e2d08e1c771306299f1aa9b288a0caca on main.
Issue
Progresses #2213 and #2032
Description
Added unit tests to check the tof mode is changed correctly when:
ToFUnitMode.WAVELENGTH
,ToFUnitMode.ENERGY
,ToFUnitMode.TOF_US
)These tests check that the tof mode is changed as expected but also if the right click units menu has the correct behaviour (i.e. disabling when there is no spectra file and enabling when there is a spectrum file).
A test has also been added to check that when there is no stack available in the spectrum viewer (i.e. it has been deleted in the Main Window), then the tof mode and right click menu behaves appropriately.
Acceptance Criteria
Test that all tests pass with
make check
Documentation
Release note