chore(history): squash 16 commit(s) from 2026-09-26
- chore(backend): sync Cargo.lock with gateway dev-dependency - feat(frontend): ClickGui replica matching the in-game GUI — category panels, Modules/Settings switch, theme cards - feat(frontend): floating glass top bar in the mod's UI language - fix(frontend): soft night backdrop for the ClickGui, editor that fits one screen - chore(frontend): replace em dashes in UI copy with lighter separators - refactor(frontend): split landing sections and theme editor into subfolders (4-files-per-folder rule) - feat(frontend): login and registration in the mod's glass panel style - feat(frontend): link the game with a device code - feat(frontend): account page with avatar upload and linked games - feat(frontend): my configs with share codes and publishing - feat(frontend): public showcase listing and detail pages - chore(frontend): drop em dashes from visible copy - feat(frontend): atmospheric backdrop, glass download block and ClickGui-style FAQ on the landing - feat(frontend): Konami code, DevTools console greeting and ASCII 404 block - feat: public player profiles at /u/:id and author link in the showcase - fix(frontend): stop the theme editor overflowing horizontally at 375px
This commit is contained in:
parent
7f4b532f99
commit
ff2edc8eb6
116 changed files with 3534 additions and 1020 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { describe, expect, test } from 'vitest'
|
||||
import { PRESETS } from '../../presets.generated'
|
||||
import { fromProfileJson, fromShareHash, toProfileJson, toShareHash } from '../codec'
|
||||
import { fromProfileJson, fromShareHash, toProfileJson, toShareHash } from '../model/codec'
|
||||
|
||||
// The mod's ThemesProfileCodec.toProfileValues writes exactly these keys, in this order.
|
||||
const PROFILE_KEYS = [
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import { fireEvent, render, screen } from '@testing-library/react'
|
||||
import { fireEvent, render, screen, within } from '@testing-library/react'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
import { expect, test } from 'vitest'
|
||||
import { PRESETS } from '../../presets.generated'
|
||||
import { ActiveThemeProvider, useActiveTheme } from '../../useActiveTheme'
|
||||
import { ThemeEditor } from '../ThemeEditor'
|
||||
|
||||
test('editor shows the initial preset name and one toggle per gradient slot', () => {
|
||||
|
|
@ -16,3 +18,24 @@ test('picking a preset chip loads it into the editor', () => {
|
|||
fireEvent.click(screen.getByRole('button', { name: next.name }))
|
||||
expect(screen.getByDisplayValue(next.name)).toBeInTheDocument()
|
||||
})
|
||||
|
||||
function SiteTheme() {
|
||||
return <output aria-label="site theme">{useActiveTheme().theme.id}</output>
|
||||
}
|
||||
|
||||
test('a theme card inside the preview loads that preset into the draft, not the site', async () => {
|
||||
const user = userEvent.setup()
|
||||
render(
|
||||
<ActiveThemeProvider applyToPage={false}>
|
||||
<SiteTheme />
|
||||
<ThemeEditor initial={PRESETS[0]} />
|
||||
</ActiveThemeProvider>,
|
||||
)
|
||||
const gui = screen.getByTestId('clickgui-root')
|
||||
await user.click(within(gui).getByRole('tab', { name: 'Settings' }))
|
||||
await user.click(within(gui).getByRole('option', { name: 'Тема Nitro' }))
|
||||
expect(screen.getByDisplayValue('Nitro')).toBeInTheDocument()
|
||||
expect(within(gui).getByRole('option', { name: 'Тема Nitro' })).toHaveAttribute('aria-selected', 'true')
|
||||
expect(screen.getByRole('status', { name: 'site theme' })).toHaveTextContent(PRESETS[0].id)
|
||||
expect(window.localStorage.getItem('lv_theme')).toBeNull()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue