Skip to content

Commit 383ef0c

Browse files
committed
Fixes #159.
1 parent 1ff848e commit 383ef0c

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
### Fixed
1919

20+
- The test that failed on the production build after change #157, passes again (#159).
21+
2022

2123
## [1.3.0] - 2024-08-07
2224

aux/cypress.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export default defineConfig({
66
experimentalRunAllSpecs: true,
77
defaultCommandTimeout: 10000, /* is OK for very slow computers */
88
baseUrl: 'http://localhost:5173',
9-
supportFile: false,
109
video: false
1110
},
1211
});

aux/cypress/e2e/sources-from-indexfile.cy.js

-15
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ describe("Sources from index file", () => {
6060

6161
it("Sources from an unauthorized source. Before and after log in.", () => {
6262

63-
// To prevent error handling returning an UnauthorizedHttpError failing the test... because we expect that to happen
64-
Cypress.on('uncaught:exception', handleUncaughtException );
65-
6663
cy.visit("/");
6764

6865
cy.intercept('GET', 'http://localhost:8080/example/index-example-texon-only-AUTH').as('getRequest');
@@ -107,18 +104,6 @@ describe("Sources from index file", () => {
107104
cy.contains("https://www.example.com/data/component-c01").should("not.exist");
108105
cy.contains("Component 1").should("exist");
109106
cy.contains("Material 1").should("exist");
110-
111-
// remove listener on the tests
112-
Cypress.off('uncaught:exception', handleUncaughtException );
113107
})
114108

115-
function handleUncaughtException(err, runnable) {
116-
// Ignore the specific UnauthorizedHttpError
117-
if (err.message.includes('UnauthorizedHttpError')) {
118-
return false;
119-
}
120-
// Let other errors fail the test
121-
return true;
122-
}
123-
124109
});

aux/cypress/support/e2e.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Cypress.on('uncaught:exception', (err, runnable) => {
2+
// this error may appear in tests that try to access resources that need authentication
3+
if (err.message.includes('UnauthorizedHttpError')) {
4+
return false;
5+
}
6+
7+
// this harmless error suddenly appears with versions "@mui/icons-material": "5.16.7", "@mui/material": "5.16.7"
8+
if (err.message.includes('ResizeObserver loop completed with undelivered notifications.')) {
9+
return false;
10+
}
11+
12+
// other uncaught exceptions cause test to fail
13+
return true;
14+
});
15+

0 commit comments

Comments
 (0)