mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
more integration tests
This commit is contained in:
parent
4b5f66d497
commit
decebc25c7
192 changed files with 3090 additions and 1657 deletions
|
|
@ -1,8 +1,10 @@
|
|||
import { Data, Enriched } from '@app/types';
|
||||
import type { IRoomResponse } from '@app/websocket';
|
||||
import { Data } from '@app/types';
|
||||
import type { IRoomResponse, WebSocketRoomResponseOverrides } from '@app/websocket';
|
||||
import { RoomsDispatch } from '@app/store';
|
||||
|
||||
export class RoomResponseImpl implements IRoomResponse {
|
||||
type Message = WebSocketRoomResponseOverrides['Event_RoomSay'];
|
||||
|
||||
export class RoomResponseImpl implements IRoomResponse<WebSocketRoomResponseOverrides> {
|
||||
clearStore(): void {
|
||||
RoomsDispatch.clearStore();
|
||||
}
|
||||
|
|
@ -23,7 +25,7 @@ export class RoomResponseImpl implements IRoomResponse {
|
|||
RoomsDispatch.updateGames(roomId, gameList);
|
||||
}
|
||||
|
||||
addMessage(roomId: number, message: Enriched.Message): void {
|
||||
addMessage(roomId: number, message: Message): void {
|
||||
RoomsDispatch.addMessage(roomId, message);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
import { App, Data, Enriched } from '@app/types';
|
||||
import type { ISessionResponse } from '@app/websocket';
|
||||
import { Data } from '@app/types';
|
||||
import type { ISessionResponse, WebSocketSessionResponseOverrides } from '@app/websocket';
|
||||
import { StatusEnum } from '@app/websocket';
|
||||
import { GameDispatch, RoomsDispatch, ServerDispatch } from '@app/store';
|
||||
|
||||
export class SessionResponseImpl implements ISessionResponse {
|
||||
type LoginSuccess = WebSocketSessionResponseOverrides['Response_Login'];
|
||||
type PendingActivation = WebSocketSessionResponseOverrides['Response'];
|
||||
|
||||
export class SessionResponseImpl implements ISessionResponse<WebSocketSessionResponseOverrides> {
|
||||
initialized(): void {
|
||||
ServerDispatch.initialized();
|
||||
}
|
||||
|
|
@ -15,7 +19,7 @@ export class SessionResponseImpl implements ISessionResponse {
|
|||
ServerDispatch.clearStore();
|
||||
}
|
||||
|
||||
loginSuccessful(options: Enriched.LoginSuccessContext): void {
|
||||
loginSuccessful(options: LoginSuccess): void {
|
||||
ServerDispatch.loginSuccessful(options);
|
||||
}
|
||||
|
||||
|
|
@ -63,8 +67,8 @@ export class SessionResponseImpl implements ISessionResponse {
|
|||
ServerDispatch.updateInfo(name, version);
|
||||
}
|
||||
|
||||
updateStatus(state: App.StatusEnum, description: string): void {
|
||||
if (state === App.StatusEnum.DISCONNECTED) {
|
||||
updateStatus(state: StatusEnum, description: string): void {
|
||||
if (state === StatusEnum.DISCONNECTED) {
|
||||
GameDispatch.clearStore();
|
||||
RoomsDispatch.clearStore();
|
||||
ServerDispatch.clearStore();
|
||||
|
|
@ -92,7 +96,7 @@ export class SessionResponseImpl implements ISessionResponse {
|
|||
ServerDispatch.serverMessage(message);
|
||||
}
|
||||
|
||||
accountAwaitingActivation(options: Enriched.PendingActivationContext): void {
|
||||
accountAwaitingActivation(options: PendingActivation): void {
|
||||
ServerDispatch.accountAwaitingActivation(options);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue