lint
This commit is contained in:
977 files changed
+198426
-158324
No files matched your search
@@ -2,33 +2,35 @@ import { describe, expect, it, vi } from 'vitest';
|
||||
import { onboardingExecution } from '../src/lib/onboarding-actions';
|
||||
|
||||
describe('developer onboarding rehearsal', () => {
|
||||
it('completes consent and password steps without writing persistent state', async () => {
|
||||
const acceptAgreements = vi.fn(async () => ({ success: true }));
|
||||
const changePassword = vi.fn(async () => ({ success: true }));
|
||||
const execution = onboardingExecution(true, {
|
||||
acceptAgreements,
|
||||
changePassword,
|
||||
it('completes consent and password steps without writing persistent state', async () => {
|
||||
const acceptAgreements = vi.fn(async () => ({ success: true }));
|
||||
const changePassword = vi.fn(async () => ({ success: true }));
|
||||
const execution = onboardingExecution(true, {
|
||||
acceptAgreements,
|
||||
changePassword,
|
||||
});
|
||||
|
||||
expect(execution.passwordMode).toBe('rehearsal');
|
||||
await expect(execution.actions.acceptAgreements()).resolves.toEqual({ success: true });
|
||||
await expect(execution.actions.changePassword('old', 'new')).resolves.toEqual({
|
||||
success: true,
|
||||
});
|
||||
expect(acceptAgreements).not.toHaveBeenCalled();
|
||||
expect(changePassword).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
expect(execution.passwordMode).toBe('rehearsal');
|
||||
await expect(execution.actions.acceptAgreements()).resolves.toEqual({ success: true });
|
||||
await expect(execution.actions.changePassword('old', 'new')).resolves.toEqual({ success: true });
|
||||
expect(acceptAgreements).not.toHaveBeenCalled();
|
||||
expect(changePassword).not.toHaveBeenCalled();
|
||||
});
|
||||
it('keeps real onboarding wired to persistent actions', async () => {
|
||||
const acceptAgreements = vi.fn(async () => ({ success: true }));
|
||||
const changePassword = vi.fn(async () => ({ success: true }));
|
||||
const execution = onboardingExecution(false, {
|
||||
acceptAgreements,
|
||||
changePassword,
|
||||
});
|
||||
|
||||
it('keeps real onboarding wired to persistent actions', async () => {
|
||||
const acceptAgreements = vi.fn(async () => ({ success: true }));
|
||||
const changePassword = vi.fn(async () => ({ success: true }));
|
||||
const execution = onboardingExecution(false, {
|
||||
acceptAgreements,
|
||||
changePassword,
|
||||
expect(execution.passwordMode).toBe('change');
|
||||
await execution.actions.acceptAgreements();
|
||||
await execution.actions.changePassword('old', 'new');
|
||||
expect(acceptAgreements).toHaveBeenCalledOnce();
|
||||
expect(changePassword).toHaveBeenCalledWith('old', 'new');
|
||||
});
|
||||
|
||||
expect(execution.passwordMode).toBe('change');
|
||||
await execution.actions.acceptAgreements();
|
||||
await execution.actions.changePassword('old', 'new');
|
||||
expect(acceptAgreements).toHaveBeenCalledOnce();
|
||||
expect(changePassword).toHaveBeenCalledWith('old', 'new');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user