Refactor series handling in backend to include player context in Toss, Ban, Pick, and Record actions. Update service methods to accept player parameters, enhancing authorization checks and ensuring proper team actions. Modify integration tests to reflect new method signatures and improve tournament hydration logic in the store. Enhance frontend components to support new series features and improve user experience with live match navigation.
Some checks failed
CI / backend (push) Has been cancelled
CI / frontend (push) Has been cancelled
CI / compose (push) Has been cancelled

This commit is contained in:
2026-07-19 03:22:32 +03:00
parent 4b8218ec14
commit 5d3e66d2f1
16 changed files with 449 additions and 62 deletions

View File

@@ -1,6 +1,8 @@
import { cleanup, render, screen } from '@testing-library/react'
import { afterEach, describe, expect, it } from 'vitest'
import App from './App'
import { demoSeries } from './api/demo'
import { activeHeroBanMap } from './series-utils'
describe('Mixmaker frontend', () => {
afterEach(() => {
@@ -15,6 +17,8 @@ describe('Mixmaker frontend', () => {
expect(screen.getByText('Saturday Night Scrim')).toBeInTheDocument()
expect(screen.getByRole('link', { name: 'Open Summer Clash #4' })).toHaveClass('status-live')
expect(screen.getByRole('link', { name: 'Open Cancelled Community Mix' })).toHaveClass('status-cancelled')
expect(screen.getByText('Ember Wolves')).toBeInTheDocument()
expect(screen.getByText('Neon Foxes')).toBeInTheDocument()
})
it('renders the Discord login screen', async () => {
@@ -26,11 +30,33 @@ describe('Mixmaker frontend', () => {
it('locks RSVP and exposes live navigation after the scrim starts', async () => {
window.history.replaceState({}, '', '/events/event-3')
render(<App />)
expect(await screen.findByRole('link', { name: /open live series/i })).toHaveAttribute('href', '/series/series-1')
expect(await screen.findByRole('link', { name: /^open live$/i })).toHaveAttribute('href', '/events/event-3/live')
expect(screen.getByRole('button', { name: 'Going' })).toBeDisabled()
expect(screen.getByText('Registration has been closed by the organizer.')).toBeInTheDocument()
})
it('keeps the full scrollable match and Bo3 ban history visible', async () => {
window.history.replaceState({}, '', '/watch/series-1')
render(<App />)
expect(await screen.findByRole('heading', { name: 'Bo3 hero ban history' })).toBeInTheDocument()
expect(screen.getByText('Ember Wolves won the toss')).toBeInTheDocument()
expect(screen.getByText('Winston')).toBeInTheDocument()
})
it('opens a roster participant in series mode', async () => {
window.history.replaceState({}, '', '/events/event-3/live')
render(<App />)
expect(await screen.findByRole('heading', { name: 'Series control' })).toBeInTheDocument()
expect(screen.getByRole('link', { name: /spectator view/i })).toHaveAttribute('href', '/watch/series-1')
})
it('does not reuse completed-map hero bans during map pick', () => {
expect(activeHeroBanMap({
...demoSeries,
currentStep: { ...demoSeries.currentStep, kind: 'map_pick' },
})).toBeUndefined()
})
it('explains map selection and captain rules in the FAQ', async () => {
window.history.replaceState({}, '', '/faq')
render(<App />)