fix quality gates

This commit is contained in:
seavor 2026-05-07 16:12:38 -05:00
parent e2319c84db
commit 6006d6f2fa
13 changed files with 70 additions and 36 deletions

View file

@ -270,7 +270,7 @@ describe('Game board integration', () => {
const labels = Array.from(zones.querySelectorAll('.zone-stack__label')).map(
(n) => n.textContent,
);
expect(labels).toEqual(['Deck', 'Graveyard', 'Exile']);
expect(labels).toEqual(['Deck', 'Hand', 'Graveyard', 'Exile']);
// Stack is now its own column, not a zone inside the rail.
expect(within(zones as HTMLElement).queryByText('Stack')).not.toBeInTheDocument();
expect(within(localBoard).getByTestId('stack-column-1')).toBeInTheDocument();

View file

@ -2,7 +2,7 @@
// and the hashed-password (salt) login path.
import { create } from '@bufbuild/protobuf';
import { describe, expect, it } from 'vitest';
import { describe, expect, it, vi } from 'vitest';
import { Data } from '@app/types';
import { store } from '@app/store';
@ -137,7 +137,7 @@ describe('authentication', () => {
});
describe('hashed-password login (salt path)', () => {
it('requests salt then sends login with hashedPassword instead of plaintext', () => {
it('requests salt then sends login with hashedPassword instead of plaintext', async () => {
connectAndHandshakeWithSalt({ userName: 'alice', password: 'secret' });
// First command should be RequestPasswordSalt, not Login
@ -153,6 +153,11 @@ describe('authentication', () => {
value: create(Data.Response_PasswordSaltSchema, { passwordSalt: 'test-salt-value' }),
})));
// Sockatrice's serverIdentification handler awaits hashPassword (1000 SHA-512 rounds)
// before dispatching Command_Login. With fake timers active, advance real-time enough
// for crypto.subtle.digest + the chained microtasks to complete.
await vi.waitFor(() => findLastSessionCommand(Data.Command_Login_ext));
// Now login should have been sent with hashedPassword
const login = findLastSessionCommand(Data.Command_Login_ext);
expect(login.value.userName).toBe('alice');