import { describe, it, expect, vi, beforeEach } from 'vitest' import { ref } from 'vue' import { useGameToast } from '../use-game-toast' // Mock the `useMaintenanceGamesStore` function const mockMaintenanceGamesStore = { startTime: ref('10:00 AM'), endTime: ref('2:00 PM'), } vi.mock('#lib/stores', () => ({ useMaintenanceGamesStore: () => mockMaintenanceGamesStore, })) describe('useGameToast', () => { beforeEach(() => { vi.clearAllMocks() }) it('should show the "coming soon" toast message', () => { const { onShowCommingSoon, isShowCommingSoon } = useGameToast() onShowCommingSoon() expect(isShowCommingSoon.value).toBe(true) }) it('should show the "promotion prevent" toast message', () => { const { onShowPromotionPrevent, isShowPromotionPrevent } = useGameToast() onShowPromotionPrevent() expect(isShowPromotionPrevent.value).toBe(true) }) it('should show the "not enough balance" toast message', () => { const { onShowNotEnoughBalance, isShowNotEnoughBalance } = useGameToast() onShowNotEnoughBalance() expect(isShowNotEnoughBalance.value).toBe(true) }) it('should show the "maintain game" toast message', () => { const { onShowMaintainGame, isShowMaintainGame } = useGameToast() onShowMaintainGame() expect(isShowMaintainGame.value).toBe(true) }) it('should show the "maintain Athena games" modal', () => { const { openModalMaintainAthenaGames, isShowMaintainAthenaGames } = useGameToast() openModalMaintainAthenaGames() expect(isShowMaintainAthenaGames.value).toBe(true) }) it('should show the "maintain provider" modal', () => { const { openMaintainProvider, isShowMaintainProvider } = useGameToast() openMaintainProvider() expect(isShowMaintainProvider.value).toBe(true) }) it('should return the correct maintenance times from the store', () => { const { maintainStartTime, maintainEndTime } = useGameToast() expect(maintainStartTime.value).toBe('10:00 AM') expect(maintainEndTime.value).toBe('2:00 PM') }) })