Skip to content

Commit

Permalink
chore: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JanCizmar committed Dec 27, 2023
1 parent 98e83ae commit b7a24b9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class SecuredKeyScreenshotControllerTest : AbstractV2ScreenshotControllerTest()
executeInNewTransaction {
val screenshots = screenshotService.findAll(key = key)
assertThat(screenshots).hasSize(1)
val bytes = fileStorage.readFile("/screenshots/" + screenshots[0].filename)
val bytes = fileStorage.readFile("screenshots/" + screenshots[0].filename)
assertThat(bytes.size).isCloseTo(1070, Offset.offset(500))
node("filename").isString.startsWith(screenshots[0].filename).satisfies {
val parts = it.split("?token=")
Expand Down
24 changes: 4 additions & 20 deletions e2e/cypress/e2e/import/importAddingFiles.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,11 @@ describe('Import Adding files', () => {
cy.get('[data-cy=dropzone]').trigger('dragenter', {
dataTransfer: dt,
});
cy.get('[data-cy=dropzone-inner]').should(
'have.css',
'background-color',
'rgb(232, 245, 233)'
);
cy.get('[data-cy=dropzone-inner]').should('have.css', 'opacity', '1');
cy.get('[data-cy=dropzone]').trigger('dragleave', {
dataTransfer: dt,
});
cy.get('[data-cy=dropzone-inner]').should(
'have.css',
'background-color',
'rgba(0, 0, 0, 0)'
);
cy.get('[data-cy=dropzone-inner]').should('have.css', 'opacity', '0');
});
});

Expand All @@ -144,19 +136,11 @@ describe('Import Adding files', () => {
cy.get('[data-cy=dropzone]').trigger('dragenter', {
dataTransfer: dt,
});
cy.get('[data-cy=dropzone-inner]').should(
'have.css',
'background-color',
'rgb(255, 235, 238)'
);
cy.get('[data-cy=dropzone-inner]').should('have.css', 'opacity', '1');
cy.get('[data-cy=dropzone]').trigger('dragleave', {
dataTransfer: dt,
});
cy.get('[data-cy=dropzone-inner]').should(
'have.css',
'background-color',
'rgba(0, 0, 0, 0)'
);
cy.get('[data-cy=dropzone-inner]').should('have.css', 'opacity', '0');
});
});

Expand Down
3 changes: 1 addition & 2 deletions e2e/cypress/e2e/import/importErrors.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'cypress-file-upload';
import { assertMessage, gcy } from '../../common/shared';
import { visitImport } from '../../common/import';
import { expectGlobalLoading } from '../../common/loading';
import { importTestData } from '../../common/apiCalls/testData/testData';
import { login } from '../../common/apiCalls/common';

Expand Down Expand Up @@ -67,7 +66,7 @@ describe('Import errors', () => {
});

it('error shows more and less', { retries: { runMode: 3 } }, () => {
expectGlobalLoading();
gcy('import-progress-overlay').should('be.visible');
gcy('import-file-error')
.findDcy('import-file-error-more-less-button')
.click();
Expand Down
1 change: 1 addition & 0 deletions e2e/cypress/support/dataCyType.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ declare namespace DataCy {
"import-file-issues-button" |
"import-file-issues-dialog" |
"import-progress" |
"import-progress-overlay" |
"import-resolution-dialog-accept-imported-button" |
"import-resolution-dialog-accept-old-button" |
"import-resolution-dialog-close-button" |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const ImportProgressOverlay = (props: {
sx={{
pointerEvents: props.importDone ? 'all' : 'none',
}}
data-cy="import-progress-overlay"
>
<ImportInputAreaLayout>
<ImportInputAreaLayoutTop>
Expand Down

0 comments on commit b7a24b9

Please sign in to comment.