Add test for imagery filter reset (#5318)

This commit is contained in:
Jesse Mazzella 2022-06-09 14:15:21 -07:00 committed by GitHub
parent 730272e165
commit f08fd58486
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -584,6 +584,34 @@ describe("The Imagery View Layouts", () => {
expect(imageSizeAfter.width).toBeLessThan(imageSizeBefore.width);
done();
});
it('should reset the brightness and contrast when clicking the reset button', async () => {
const viewInstance = imageryView._getInstance();
await Vue.nextTick();
// Save the original brightness and contrast values
const origBrightness = viewInstance.$refs.ImageryContainer.filters.brightness;
const origContrast = viewInstance.$refs.ImageryContainer.filters.contrast;
// Change them to something else (default: 100)
viewInstance.$refs.ImageryContainer.setFilters({
brightness: 200,
contrast: 200
});
await Vue.nextTick();
// Verify that the values actually changed
expect(viewInstance.$refs.ImageryContainer.filters.brightness).toBe(200);
expect(viewInstance.$refs.ImageryContainer.filters.contrast).toBe(200);
// Click the reset button
parent.querySelector('.t-btn-reset').click();
await Vue.nextTick();
// Verify that the values were reset
expect(viewInstance.$refs.ImageryContainer.filters.brightness).toBe(origBrightness);
expect(viewInstance.$refs.ImageryContainer.filters.contrast).toBe(origContrast);
});
});
describe("imagery time strip view", () => {