Adding end-to-end tests
The first test is testing a tricky cache scenario with the back when testing variables. The end-to-end package used is testcafe.
This commit is contained in:
parent
d8ecae64f0
commit
a82f4e1813
17 changed files with 9243 additions and 5 deletions
|
@ -122,10 +122,12 @@ class LocalUserStore {
|
|||
|
||||
setLastRoomUrl(roomUrl: string): void {
|
||||
localStorage.setItem(lastRoomUrl, roomUrl.toString());
|
||||
caches.open(cacheAPIIndex).then((cache) => {
|
||||
const stringResponse = new Response(JSON.stringify({ roomUrl }));
|
||||
cache.put(`/${lastRoomUrl}`, stringResponse);
|
||||
});
|
||||
if ('caches' in window) {
|
||||
caches.open(cacheAPIIndex).then((cache) => {
|
||||
const stringResponse = new Response(JSON.stringify({ roomUrl }));
|
||||
cache.put(`/${lastRoomUrl}`, stringResponse);
|
||||
});
|
||||
}
|
||||
}
|
||||
getLastRoomUrl(): string {
|
||||
return (
|
||||
|
@ -133,6 +135,9 @@ class LocalUserStore {
|
|||
);
|
||||
}
|
||||
getLastRoomUrlCacheApi(): Promise<string | undefined> {
|
||||
if (!('caches' in window)) {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
return caches.open(cacheAPIIndex).then((cache) => {
|
||||
return cache.match(`/${lastRoomUrl}`).then((res) => {
|
||||
return res?.json().then((data) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue