2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-20 05:46:34 +00:00

[PUI] Test for errors in console (#7114)

* ensure no errors are thrown in the console

* fix key issue

* add missing keys

* fix table order

* fix wrong imports

* add missing key

* fix accessor ref

* fix style

* mark internal fetching errors and ignore them

* do not raise internal errors

* ignore barcode api calls

* style fix

* do not raise on chrome errors

* refactor url

* more exclusion

* remove duplicate assertation
This commit is contained in:
Matthias Mair
2024-04-25 11:26:04 +02:00
committed by GitHub
parent 47c797db88
commit b5b0ff2666
15 changed files with 62 additions and 27 deletions

View File

@ -50,6 +50,24 @@ export const test = baseTest.extend({
)
);
}
},
// Ensure no errors are thrown in the console
page: async ({ baseURL, page }, use) => {
const messages = [];
page.on('console', (msg) => {
const url = msg.location().url;
if (
msg.type() === 'error' &&
!msg.text().startsWith('ERR: ') &&
url != 'http://localhost:8000/api/barcode/' &&
url != 'http://localhost:8000/api/news/?search=&offset=0&limit=25' &&
url != 'https://docs.inventree.org/en/versions.json' &&
!url.startsWith('chrome://')
)
messages.push(msg);
});
await use(page);
expect(messages).toEqual([]);
}
});