Compare commits
2 Commits
6de0690b76
...
ae10f5272f
| Author | SHA1 | Date | |
|---|---|---|---|
| ae10f5272f | |||
| a8472ddeed |
@@ -32,6 +32,7 @@ const employee = {
|
||||
preferredLanguage: 'fr',
|
||||
companyId: 'company_1',
|
||||
isActive: true,
|
||||
emailVerified: true,
|
||||
passwordHash: 'hash_old',
|
||||
company: { name: 'Atlas Cars', slug: 'atlas' },
|
||||
}
|
||||
@@ -73,6 +74,15 @@ describe('auth.employee.service edge behavior', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('rejects login for employees whose email has not been verified', async () => {
|
||||
vi.mocked(repo.findEmployeeWithCompanyByEmail).mockResolvedValue({ ...employee, emailVerified: false } as never)
|
||||
|
||||
await expect(service.login({ email: 'agent@example.test', password: 'correct-password' })).rejects.toMatchObject({
|
||||
statusCode: 401,
|
||||
error: 'email_not_verified',
|
||||
})
|
||||
})
|
||||
|
||||
it('distinguishes employees without passwords from wrong credentials', async () => {
|
||||
vi.mocked(repo.findEmployeeWithCompanyByEmail).mockResolvedValue({ ...employee, passwordHash: null } as never)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { describe, expect, it } from 'vitest';
|
||||
describe('homepage pricing configuration', () => {
|
||||
it('keeps commercial values in one guarded configuration', () => {
|
||||
expect(pricingCommercialConfig.publicPricesApproved).toBe(false);
|
||||
expect(pricingCommercialConfig.currency).toBe('USD');
|
||||
expect(pricingCommercialConfig.currency).toBe('MAD');
|
||||
expect(pricingCommercialConfig.annualDiscountPercent).toBeNull();
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2024",
|
||||
"target": "ES2022",
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
|
||||
Generated
+83
-3979
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -81,6 +81,7 @@
|
||||
},
|
||||
"packageManager": "npm@10.5.0",
|
||||
"dependencies": {
|
||||
"nodemailer": "9.0.1"
|
||||
"nodemailer": "9.0.1",
|
||||
"react-dom": "^19.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user