0
owncast/web/services/chat-service.mock.ts
Michael David Kuckuk b38df2fbe3
Create stories for layout testing (#2722)
* Inject services with useContext

* Extract service for video settings

* Create mock factories for services

* Create test data for chat history

* Add story to visualize different layouts

* Fix renaming mistake

* Add landscape and portrait viewports

* Add landscape stories

---------

Co-authored-by: Gabe Kangas <gabek@real-ity.com>
2023-02-26 16:54:28 -08:00

19 lines
573 B
TypeScript

import { ChatMessage } from '../interfaces/chat-message.model';
import { ChatStaticService, UserRegistrationResponse } from './chat-service';
export const chatServiceMockOf = (
chatHistory: ChatMessage[],
userRegistrationResponse: UserRegistrationResponse,
): ChatStaticService =>
class ChatServiceMock {
public static async getChatHistory(): Promise<ChatMessage[]> {
return chatHistory;
}
public static async registerUser(): Promise<UserRegistrationResponse> {
return userRegistrationResponse;
}
};
export default chatServiceMockOf;