Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ae10f5272f | |||
| a8472ddeed |
@@ -32,6 +32,7 @@ const employee = {
|
|||||||
preferredLanguage: 'fr',
|
preferredLanguage: 'fr',
|
||||||
companyId: 'company_1',
|
companyId: 'company_1',
|
||||||
isActive: true,
|
isActive: true,
|
||||||
|
emailVerified: true,
|
||||||
passwordHash: 'hash_old',
|
passwordHash: 'hash_old',
|
||||||
company: { name: 'Atlas Cars', slug: 'atlas' },
|
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 () => {
|
it('distinguishes employees without passwords from wrong credentials', async () => {
|
||||||
vi.mocked(repo.findEmployeeWithCompanyByEmail).mockResolvedValue({ ...employee, passwordHash: null } as never)
|
vi.mocked(repo.findEmployeeWithCompanyByEmail).mockResolvedValue({ ...employee, passwordHash: null } as never)
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { describe, expect, it } from 'vitest';
|
|||||||
describe('homepage pricing configuration', () => {
|
describe('homepage pricing configuration', () => {
|
||||||
it('keeps commercial values in one guarded configuration', () => {
|
it('keeps commercial values in one guarded configuration', () => {
|
||||||
expect(pricingCommercialConfig.publicPricesApproved).toBe(false);
|
expect(pricingCommercialConfig.publicPricesApproved).toBe(false);
|
||||||
expect(pricingCommercialConfig.currency).toBe('USD');
|
expect(pricingCommercialConfig.currency).toBe('MAD');
|
||||||
expect(pricingCommercialConfig.annualDiscountPercent).toBeNull();
|
expect(pricingCommercialConfig.annualDiscountPercent).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2024",
|
"target": "ES2022",
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
"dom.iterable",
|
"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",
|
"packageManager": "npm@10.5.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nodemailer": "9.0.1"
|
"nodemailer": "9.0.1",
|
||||||
|
"react-dom": "^19.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user