chore(prettier): full repo linting and code reformatting once and for all (#3627)

This commit is contained in:
Alireza authored and GitHub committed 2023-09-01 16:19:39 -04:00
1 parent 01500a2d4c
commit 9045ddaedc
656 files changed
+21737 -20628

No files matched your search

@@ -12,17 +12,11 @@ describe('OHIF Multi Study', () => {
it('Should display 2 comparison up', () => {
beforeSetup();
cy.get('[data-cy="viewport-pane"]')
.its('length')
.should('be.eq', 4);
cy.get('[data-cy="viewport-pane"]').its('length').should('be.eq', 4);
cy.get('[data-cy="studyDate"]').should(studyDate => {
expect(studyDate.length).to.be.eq(4);
expect(studyDate.text())
.to.contain('2014')
.contain('2001');
expect(studyDate.text().indexOf('2014')).to.be.lessThan(
studyDate.text().indexOf('2001')
);
expect(studyDate.text()).to.contain('2014').contain('2001');
expect(studyDate.text().indexOf('2014')).to.be.lessThan(studyDate.text().indexOf('2001'));
});
});
});
@@ -1,13 +1,11 @@
describe('OHIF PDF Display', function() {
beforeEach(function() {
describe('OHIF PDF Display', function () {
beforeEach(function () {
cy.openStudyInViewer('2.25.317377619501274872606137091638706705333');
cy.resetViewport().wait(50);
});
it('checks if series thumbnails are being displayed', function() {
cy.get('[data-cy="study-browser-thumbnail-no-image"]')
.its('length')
.should('be.gt', 0);
it('checks if series thumbnails are being displayed', function () {
cy.get('[data-cy="study-browser-thumbnail-no-image"]').its('length').should('be.gt', 0);
});
});
@@ -1,19 +1,15 @@
describe('OHIF Video Display', function() {
beforeEach(function() {
describe('OHIF Video Display', function () {
beforeEach(function () {
cy.openStudyInViewer('2.25.96975534054447904995905761963464388233');
cy.resetViewport().wait(50);
});
it('checks if series thumbnails are being displayed', function() {
cy.get('[data-cy="study-browser-thumbnail-no-image"]')
.its('length')
.should('be.gt', 1);
it('checks if series thumbnails are being displayed', function () {
cy.get('[data-cy="study-browser-thumbnail-no-image"]').its('length').should('be.gt', 1);
});
it('performs double-click to load thumbnail in active viewport', () => {
cy.get(
'[data-cy="study-browser-thumbnail-no-image"]:nth-child(2)'
).dblclick();
cy.get('[data-cy="study-browser-thumbnail-no-image"]:nth-child(2)').dblclick();
//const expectedText = 'Ser: 3';
//cy.get('@viewportInfoBottomLeft').should('contains.text', expectedText);
@@ -12,9 +12,7 @@ describe('OHIF HP', () => {
it('Should display 3 up', () => {
beforeSetup();
cy.get('[data-cy="viewport-pane"]')
.its('length')
.should('be.eq', 3);
cy.get('[data-cy="viewport-pane"]').its('length').should('be.eq', 3);
});
it('Should navigate next/previous stage', () => {
@@ -22,15 +20,11 @@ describe('OHIF HP', () => {
cy.get('body').type(',');
cy.wait(250);
cy.get('[data-cy="viewport-pane"]')
.its('length')
.should('be.eq', 4);
cy.get('[data-cy="viewport-pane"]').its('length').should('be.eq', 4);
cy.get('body').type('..');
cy.wait(250);
cy.get('[data-cy="viewport-pane"]')
.its('length')
.should('be.eq', 2);
cy.get('[data-cy="viewport-pane"]').its('length').should('be.eq', 2);
});
it('Should navigate to display set specified', () => {
@@ -11,9 +11,7 @@ describe('OHIF Double Click', () => {
it('Should double click each viewport to one up and back', () => {
const numExpectedViewports = 3;
cy.get('[data-cy="viewport-pane"]')
.its('length')
.should('be.eq', numExpectedViewports);
cy.get('[data-cy="viewport-pane"]').its('length').should('be.eq', numExpectedViewports);
for (let i = 0; i < numExpectedViewports; i += 1) {
cy.wait(2000);
@@ -38,13 +36,9 @@ describe('OHIF Double Click', () => {
.not('.pointer-events-none');
// The actual double click.
cy.get('[data-cy="viewport-pane"]')
.eq(i)
.trigger('dblclick', 'center');
cy.get('[data-cy="viewport-pane"]').eq(i).trigger('dblclick', 'center');
cy.get('[data-cy="viewport-pane"]')
.its('length')
.should('be.eq', 1);
cy.get('[data-cy="viewport-pane"]').its('length').should('be.eq', 1);
cy.get('[data-cy="viewport-pane"]')
.trigger('mousedown', 'center', {
@@ -54,9 +48,7 @@ describe('OHIF Double Click', () => {
force: true,
});
cy.get('[data-cy="viewport-pane"]')
.eq(0)
.trigger('dblclick', 'center');
cy.get('[data-cy="viewport-pane"]').eq(0).trigger('dblclick', 'center');
}
});
});
@@ -1,8 +1,6 @@
describe('OHIF Context Menu', function() {
beforeEach(function() {
cy.checkStudyRouteInViewer(
'1.2.840.113619.2.5.1762583153.215519.978957063.78'
);
describe('OHIF Context Menu', function () {
beforeEach(function () {
cy.checkStudyRouteInViewer('1.2.840.113619.2.5.1762583153.215519.978957063.78');
cy.expectMinimumThumbnails(3);
cy.initCommonElementsAliases();
@@ -10,7 +8,7 @@ describe('OHIF Context Menu', function() {
cy.resetViewport().wait(50);
});
it('checks context menu customization', function() {
it('checks context menu customization', function () {
// Add length measurement
cy.addLengthMeasurement();
cy.get('[data-cy="prompt-begin-tracking-yes-btn"]').click();
@@ -29,14 +27,10 @@ describe('OHIF Context Menu', function() {
cy.get('[data-cy="context-menu"]').should('be.visible');
// Click "Finding" subMenu
cy.get('[data-cy="context-menu-item"]')
.contains('Finding')
.click();
cy.get('[data-cy="context-menu-item"]').contains('Finding').click();
// Click "Finding" subMenu
cy.get('[data-cy="context-menu-item"]')
.contains('Aortic insufficiency')
.click();
cy.get('[data-cy="context-menu-item"]').contains('Aortic insufficiency').click();
cy.get('[data-cy="measurement-item"]').contains('Aortic insufficiency');
});
});
@@ -1,17 +1,13 @@
describe('OHIF Cornerstone Hotkeys', () => {
beforeEach(() => {
cy.checkStudyRouteInViewer(
'1.2.840.113619.2.5.1762583153.215519.978957063.78'
);
cy.checkStudyRouteInViewer('1.2.840.113619.2.5.1762583153.215519.978957063.78');
cy.window()
.its('cornerstone')
.then(cornerstone => {
// For debugging issues where tests pass locally but fail on CI
// - Sometimes Cypress orb seems to use CPU rendering pathway
cy.log(
`Cornerstone using CPU Rendering?: ${cornerstone.getShouldUseCPURendering()}`
);
cy.log(`Cornerstone using CPU Rendering?: ${cornerstone.getShouldUseCPURendering()}`);
});
cy.expectMinimumThumbnails(3);
@@ -1,15 +1,11 @@
describe('OHIF Cornerstone Toolbar', () => {
beforeEach(() => {
cy.checkStudyRouteInViewer(
'1.2.840.113619.2.5.1762583153.215519.978957063.78'
);
cy.checkStudyRouteInViewer('1.2.840.113619.2.5.1762583153.215519.978957063.78');
cy.expectMinimumThumbnails(3);
cy.initCornerstoneToolsAliases();
cy.initCommonElementsAliases();
cy.get('[data-cy="study-browser-thumbnail"]')
.eq(1)
.click();
cy.get('[data-cy="study-browser-thumbnail"]').eq(1).click();
//const expectedText = 'Ser: 1';
//cy.get('@viewportInfoBottomLeft').should('contains.text', expectedText);
@@ -89,9 +85,7 @@ describe('OHIF Cornerstone Toolbar', () => {
// The exact text is slightly dependent on the viewport resolution, so leave a range
cy.get('@viewportInfoTopLeft').should($txt => {
const text = $txt.text();
expect(text)
.to.include('W:193')
.include('L:479');
expect(text).to.include('W:193').include('L:479');
});
});
@@ -119,9 +113,7 @@ describe('OHIF Cornerstone Toolbar', () => {
//Verify the measurement exists in the table
cy.get('@measurementsPanel').should('be.visible');
cy.get('[data-cy="measurement-item"]')
.its('length')
.should('be.at.least', 1);
cy.get('[data-cy="measurement-item"]').its('length').should('be.at.least', 1);
});
/*it('checks if angle annotation can be added on viewport without causing any errors', () => {
@@ -1,13 +1,11 @@
describe('OHIF Download Snapshot File', () => {
beforeEach(() => {
cy.checkStudyRouteInViewer(
'1.2.840.113619.2.5.1762583153.215519.978957063.78'
);
cy.checkStudyRouteInViewer('1.2.840.113619.2.5.1762583153.215519.978957063.78');
cy.expectMinimumThumbnails(3);
cy.openDownloadImageModal();
});
it('checks displayed information for Desktop experience', function() {
it('checks displayed information for Desktop experience', function () {
// Set Desktop resolution
// cy.viewport(1750, 720);
// Visual comparison
@@ -36,12 +34,8 @@ describe('OHIF Download Snapshot File', () => {
// .and('include', 'data:image');
// Check buttons
cy.get('[data-cy="cancel-btn"]')
.scrollIntoView()
.should('be.visible');
cy.get('[data-cy="download-btn"]')
.scrollIntoView()
.should('be.visible');
cy.get('[data-cy="cancel-btn"]').scrollIntoView().should('be.visible');
cy.get('[data-cy="download-btn"]').scrollIntoView().should('be.visible');
});
/*it('cancel changes on download modal', function() {
@@ -1,21 +1,19 @@
describe('OHIF Study Viewer Page', function() {
beforeEach(function() {
cy.checkStudyRouteInViewer(
'1.2.840.113619.2.5.1762583153.215519.978957063.78'
);
describe('OHIF Study Viewer Page', function () {
beforeEach(function () {
cy.checkStudyRouteInViewer('1.2.840.113619.2.5.1762583153.215519.978957063.78');
cy.expectMinimumThumbnails(3);
cy.initCommonElementsAliases();
cy.initCornerstoneToolsAliases();
});
it('scrolls series stack using scrollbar', function() {
it('scrolls series stack using scrollbar', function () {
cy.scrollToIndex(13);
cy.get('@viewportInfoTopRight').should('contains.text', '14');
});
it('performs right click to zoom', function() {
it('performs right click to zoom', function () {
// This is not used to activate the tool, it is used to ensure the
// top left viewport info shows the zoom values (it only shows up
// when the zoom tool is active)
@@ -25,11 +23,9 @@ describe('OHIF Study Viewer Page', function() {
cy.wrap($zoomBtn).should('have.class', 'active');
});
const zoomLevelInitial = cy
.get('@viewportInfoTopLeft')
.then($viewportInfo => {
return $viewportInfo.text().substring(6, 9);
});
const zoomLevelInitial = cy.get('@viewportInfoTopLeft').then($viewportInfo => {
return $viewportInfo.text().substring(6, 9);
});
//Right click on viewport
cy.get('@viewport')
@@ -1,8 +1,6 @@
describe('OHIF Measurement Panel', function() {
beforeEach(function() {
cy.checkStudyRouteInViewer(
'1.2.840.113619.2.5.1762583153.215519.978957063.78'
);
describe('OHIF Measurement Panel', function () {
beforeEach(function () {
cy.checkStudyRouteInViewer('1.2.840.113619.2.5.1762583153.215519.978957063.78');
cy.expectMinimumThumbnails(3);
cy.initCommonElementsAliases();
@@ -11,7 +9,7 @@ describe('OHIF Measurement Panel', function() {
cy.waitDicomImage();
});
it('checks if Measurements right panel can be hidden/displayed', function() {
it('checks if Measurements right panel can be hidden/displayed', function () {
cy.get('@measurementsPanel').should('exist');
cy.get('@measurementsPanel').should('be.visible');
@@ -23,7 +21,7 @@ describe('OHIF Measurement Panel', function() {
cy.get('@measurementsPanel').should('be.visible');
});
it('checks if measurement item can be Relabeled under Measurements panel', function() {
it('checks if measurement item can be Relabeled under Measurements panel', function () {
// Add length measurement
cy.addLengthMeasurement();
cy.get('[data-cy="viewport-notification"]').should('exist');
@@ -31,9 +29,7 @@ describe('OHIF Measurement Panel', function() {
cy.get('[data-cy="prompt-begin-tracking-yes-btn"]').click();
cy.get('[data-cy="measurement-item"]').click();
cy.get('[data-cy="measurement-item"]')
.find('svg')
.click();
cy.get('[data-cy="measurement-item"]').find('svg').click();
// enter Bone label
cy.get('[data-cy="input-annotation"]').should('exist');
@@ -44,7 +40,7 @@ describe('OHIF Measurement Panel', function() {
cy.get('[data-cy="measurement-item"]').should('contain.text', 'Bone');
});
it('checks if image would jump when clicked on a measurement item', function() {
it('checks if image would jump when clicked on a measurement item', function () {
// Add length measurement
cy.addLengthMeasurement();
cy.get('[data-cy="prompt-begin-tracking-yes-btn"]').click();
@@ -56,9 +52,7 @@ describe('OHIF Measurement Panel', function() {
cy.get('@viewportInfoTopRight').should('contains.text', '(14/');
// Click on first measurement item
cy.get('[data-cy="measurement-item"]')
.eq(0)
.click();
cy.get('[data-cy="measurement-item"]').eq(0).click();
cy.get('@viewportInfoTopRight').should('contains.text', '(1/');
cy.get('@viewportInfoTopRight').should('not.contains.text', '(14/');
@@ -1,8 +1,6 @@
describe('OHIF Study Viewer Page', function() {
beforeEach(function() {
cy.checkStudyRouteInViewer(
'1.2.840.113619.2.5.1762583153.215519.978957063.78'
);
describe('OHIF Study Viewer Page', function () {
beforeEach(function () {
cy.checkStudyRouteInViewer('1.2.840.113619.2.5.1762583153.215519.978957063.78');
cy.expectMinimumThumbnails(3);
cy.initCommonElementsAliases();
@@ -10,13 +8,11 @@ describe('OHIF Study Viewer Page', function() {
cy.resetViewport().wait(50);
});
it('checks if series thumbnails are being displayed', function() {
cy.get('[data-cy="study-browser-thumbnail"]')
.its('length')
.should('be.gt', 1);
it('checks if series thumbnails are being displayed', function () {
cy.get('[data-cy="study-browser-thumbnail"]').its('length').should('be.gt', 1);
});
it('drags and drop a series thumbnail into viewport', function() {
it('drags and drop a series thumbnail into viewport', function () {
// Can't use the native drag version as the element should be rerendered
// cy.get('[data-cy="study-browser-thumbnail"]:nth-child(2)') //element to be dragged
// .drag('.cornerstone-canvas'); //dropzone element
@@ -38,7 +34,7 @@ describe('OHIF Study Viewer Page', function() {
//cy.get('@viewportInfoBottomLeft').should('contain.text', expectedText);
});
it('checks if Series left panel can be hidden/displayed', function() {
it('checks if Series left panel can be hidden/displayed', function () {
cy.get('@seriesPanel').should('exist');
cy.get('@seriesPanel').should('be.visible');
@@ -1,8 +1,8 @@
//We are keeping the hardcoded results values for the study list tests
//this is intended to be running in a controled docker environment with test data.
describe('OHIF Study List', function() {
context('Desktop resolution', function() {
beforeEach(function() {
describe('OHIF Study List', function () {
context('Desktop resolution', function () {
beforeEach(function () {
cy.openStudyList();
cy.viewport(1750, 720);
@@ -14,7 +14,7 @@ describe('OHIF Study List', function() {
cy.get('@StudyDescription').clear();
});
it('Displays several studies initially', function() {
it('Displays several studies initially', function () {
cy.waitStudyList();
cy.get('@searchResult2').should($list => {
expect($list.length).to.be.greaterThan(1);
@@ -23,7 +23,7 @@ describe('OHIF Study List', function() {
});
});
it('searches Patient Name with exact string', function() {
it('searches Patient Name with exact string', function () {
cy.get('@PatientName').type('Juno');
//Wait result list to be displayed
cy.waitStudyList();
@@ -33,7 +33,7 @@ describe('OHIF Study List', function() {
});
});
it('searches MRN with exact string', function() {
it('searches MRN with exact string', function () {
cy.get('@MRN').type('0000003');
//Wait result list to be displayed
cy.waitStudyList();
@@ -43,7 +43,7 @@ describe('OHIF Study List', function() {
});
});
it('searches Accession with exact string', function() {
it('searches Accession with exact string', function () {
cy.get('@AccessionNumber').type('321');
//Wait result list to be displayed
cy.waitStudyList();
@@ -53,7 +53,7 @@ describe('OHIF Study List', function() {
});
});
it('searches Description with exact string', function() {
it('searches Description with exact string', function () {
cy.get('@StudyDescription').type('PETCT');
//Wait result list to be displayed
cy.waitStudyList();
@@ -1,8 +1,6 @@
describe('OHIF MPR', () => {
beforeEach(() => {
cy.checkStudyRouteInViewer(
'1.3.6.1.4.1.25403.345050719074.3824.20170125113417.1'
);
cy.checkStudyRouteInViewer('1.3.6.1.4.1.25403.345050719074.3824.20170125113417.1');
cy.expectMinimumThumbnails(3);
cy.initCornerstoneToolsAliases();
cy.initCommonElementsAliases();
@@ -76,10 +74,7 @@ describe('OHIF MPR', () => {
cy.wrap(imageData2).should('not.be', undefined);
cy.wrap(imageData3).should('not.be', undefined);
cy.wrap(imageData1.dimensions).should(
'deep.equal',
imageData2.dimensions
);
cy.wrap(imageData1.dimensions).should('deep.equal', imageData2.dimensions);
cy.wrap(imageData1.origin).should('deep.equal', imageData2.origin);
});
@@ -89,10 +84,7 @@ describe('OHIF MPR', () => {
cy.get('.cornerstone-canvas').should('have.length', 1);
// should not have any div under it
cy.get('[data-cy="thumbnail-viewport-labels"]')
.eq(2)
.find('div')
.should('have.length', 0);
cy.get('[data-cy="thumbnail-viewport-labels"]').eq(2).find('div').should('have.length', 0);
});
it('should correctly render Crosshairs for MPR', () => {