ed
This commit is contained in:
parent
600d79af31
commit
5d11084641
136 changed files with 12007 additions and 584 deletions
45
resources/[freizeit]/[gym]/ps-ui/web/utils/mockEvent.ts
Normal file
45
resources/[freizeit]/[gym]/ps-ui/web/utils/mockEvent.ts
Normal file
|
@ -0,0 +1,45 @@
|
|||
import type { IImage } from './../src/interfaces/IImage';
|
||||
export default function mockEventCall(data: unknown = {}) {
|
||||
window.dispatchEvent(new MessageEvent('message', { data }));
|
||||
}
|
||||
|
||||
export function newMemoryGameMock() {
|
||||
setTimeout(() => {
|
||||
mockEventCall({
|
||||
action: 'MemoryGame',
|
||||
data: {
|
||||
game: 'MemoryGame',
|
||||
amountOfAnswers: 1,
|
||||
gameTime: 5,
|
||||
maxAnswersIncorrect: 2,
|
||||
triggerEvent: '',
|
||||
},
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
|
||||
export function showImageMock() {
|
||||
setTimeout(() => {
|
||||
mockEventCall({
|
||||
action: 'ShowImage',
|
||||
data: {
|
||||
show: true,
|
||||
url: 'https://i.ytimg.com/vi/7V15_-32iCU/maxresdefault.jpg',
|
||||
},
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
|
||||
export function notificationMock() {
|
||||
setTimeout(() => {
|
||||
mockEventCall({
|
||||
action: 'ShowNotification',
|
||||
data: {
|
||||
text: 'New notification',
|
||||
type: 'ps-notification-success',
|
||||
icon: 'fa-solid fa-times',
|
||||
length: 5000,
|
||||
},
|
||||
});
|
||||
}, 500);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue