mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-06 13:33:55 -07:00
fix quality gates
This commit is contained in:
parent
e2319c84db
commit
6006d6f2fa
13 changed files with 70 additions and 36 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue