Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • web-et-numerique/factory/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_server
1 result
Show changes
......@@ -2,6 +2,7 @@ import { Injectable, Logger } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { IUser } from '../interfaces/user.interface';
import { UserRegistrySearchBody } from '../interfaces/userRegistry-search-body.interface';
import { IUserRegistry, UserRegistryPaginatedResponse } from '../interfaces/userRegistry.interface';
import { Employer } from '../schemas/employer.schema';
import { Job } from '../schemas/job.schema';
......@@ -131,7 +132,7 @@ export class UserRegistryService {
}
// SEARCH
public async searchByNameAndSurname(searchString: string): Promise<any[]> {
public async searchByNameAndSurname(searchString: string): Promise<UserRegistrySearchBody[]> {
this.logger.debug('searchByNameAndSurname');
return this.userRegistrySearchService.search(searchString);
}
......
......@@ -14,7 +14,6 @@ import { ConfigurationModule } from '../../configuration/configuration.module';
import { MailerModule } from '../../mailer/mailer.module';
import { MailerService } from '../../mailer/mailer.service';
import { PersonalOfferDocument } from '../../personal-offers/schemas/personal-offer.schema';
import { EmailChangeDto } from '../dto/change-email.dto';
import { CreateUserDto } from '../dto/create-user.dto';
import { DescriptionDto } from '../dto/description.dto';
import { UpdateDetailsDto } from '../dto/update-details.dto';
......@@ -30,20 +29,20 @@ function hashPassword() {
}
type mockUserModelFunctionTypes = {
create: jest.Mock<any, any>;
deleteOne: jest.Mock<any, any>;
exec: jest.Mock<any, any>;
find: jest.Mock<any, any>;
findById: jest.Mock<any, any>;
findByIdAndUpdate: jest.Mock<any, any>;
findOne: jest.Mock<any, any>;
findPopulatedUserRegistryById: jest.Mock<any, any>;
limit: jest.Mock<any, any>;
populate: jest.Mock<any, any>;
select: jest.Mock<any, any>;
sort: jest.Mock<any, any>;
updateMany: jest.Mock<any, any>;
updateOne: jest.Mock<any, any>;
create: jest.Mock;
deleteOne: jest.Mock;
exec: jest.Mock;
find: jest.Mock;
findById: jest.Mock;
findByIdAndUpdate: jest.Mock;
findOne: jest.Mock;
findPopulatedUserRegistryById: jest.Mock;
limit: jest.Mock;
populate: jest.Mock;
select: jest.Mock;
sort: jest.Mock;
updateMany: jest.Mock;
updateOne: jest.Mock;
};
const mockUserModel: mockUserModelFunctionTypes = {
......@@ -165,7 +164,7 @@ describe('UsersService', () => {
});
it('should not create User, weak password', async () => {
jest.spyOn(service, 'findOne').mockImplementationOnce(async (): Promise<any> => null);
jest.spyOn(service, 'findOne').mockImplementationOnce(async () => null);
jest.spyOn(service, 'isStrongPassword').mockImplementationOnce(() => false);
try {
await service.create(createUserDto);
......@@ -178,7 +177,7 @@ describe('UsersService', () => {
}
});
it('should create a User', async () => {
jest.spyOn(service, 'findOne').mockImplementationOnce(async (): Promise<any> => null);
jest.spyOn(service, 'findOne').mockImplementationOnce(async () => null);
jest.spyOn(service, 'isStrongPassword').mockImplementationOnce(() => true);
//TODO mock new userModal(createUserDto)
return;
......@@ -262,12 +261,19 @@ describe('UsersService', () => {
it('wrong password, should be unauthorized issue', async () => {
const result: HttpException = new HttpException('Invalid credentials', HttpStatus.UNAUTHORIZED);
const loginDto: LoginDto = { email: 'jacques.dupont@mii.com', password: 'test1A!!!' }; //NOSONAR
jest.spyOn(service, 'findByLogin').mockImplementation(async (): Promise<any> => result);
expect(await service.findByLogin(loginDto)).toBe(result);
jest.spyOn(service, 'findOne').mockResolvedValue(null);
try {
await service.findByLogin(loginDto);
expect(true).toBe(false);
} catch (error) {
expect(error.status).toBe(HttpStatus.UNAUTHORIZED);
expect(error.message).toBe('Invalid credentials');
}
});
});
describe('validateUser', () => {
// TODO implement correct tests
it('should not validateUser', async () => {
const result = new HttpException('Invalid token', HttpStatus.UNAUTHORIZED);
jest.spyOn(service, 'validateUser').mockImplementation(async (): Promise<HttpException> => result);
......@@ -276,174 +282,19 @@ describe('UsersService', () => {
});
describe('changeUserPassword', () => {
it('should not change password', async () => {
const result = new HttpException('Invalid token', HttpStatus.UNAUTHORIZED);
jest.spyOn(service, 'changeUserPassword').mockImplementation(async (): Promise<HttpException> => result);
expect(await service.changeUserPassword('add3d', 'azertyU1', 'azertyU1!d')).toBe(result);
});
it('should not change password', async () => {
const result = new HttpException('Invalid token', HttpStatus.UNPROCESSABLE_ENTITY);
jest.spyOn(service, 'changeUserPassword').mockImplementation(async (): Promise<HttpException> => result);
expect(await service.changeUserPassword('add3d', 'azertyU1!d', 'a')).toBe(result);
});
it('should change password', async () => {
const result = new HttpException('Invalid token', HttpStatus.CREATED);
jest.spyOn(service, 'changeUserPassword').mockImplementation(async (): Promise<HttpException> => result);
expect(await service.changeUserPassword('add3d', 'azertyU1!d', 'azertyU1!d')).toBe(result);
});
// TODO implement correct tests
});
describe('changeUserEmail', () => {
it('should find and add token', async () => {
const result = {
validationToken: '',
emailVerified: true,
email: 'jacques.dupont@mii.com',
password: hashPassword(),
role: 0,
newEmail: 'test.dupont@mail.com',
resetPasswordToken: '',
structuresLink: [],
pendingStructuresLink: [],
structureOutdatedMailSent: [],
personalOffers: [],
name: 'Jacques',
surname: 'Dupont',
phone: '06 06 06 06 06',
createdAt: new Date('2022-05-25T09:48:28.824Z'),
changeEmailToken:
'9bb3542bdc5ca8801ad4cee00403c1052bc95dee768dcbb65b1f719870578ed79f71f52fdc3e6bf02fd200a72b8b6f56fc26950df30c8cd7e427a485f80181b9',
employer: {
name: 'test',
validated: true,
},
job: {
name: 'test',
validated: true,
hasPersonalOffer: false,
},
unattachedSince: null,
};
const emailDto: EmailChangeDto = { newEmail: 'test.dupont@mail.com', oldEmail: 'jacques.dupont@mii.com' }; //NOSONAR
jest.spyOn(service, 'changeUserEmail').mockImplementation(async (): Promise<User> => result);
expect(await service.changeUserEmail(emailDto)).toBe(result);
});
it('user does not exist, should be unauthorized issue', async () => {
const result: HttpException = new HttpException('Email sent if account exist', HttpStatus.UNAUTHORIZED);
const emailDto: EmailChangeDto = { newEmail: 'test.dupont@mail.com', oldEmail: 'jacques.dupont@mii.com' }; //NOSONAR
jest.spyOn(service, 'changeUserEmail').mockImplementation(async (): Promise<any> => result);
expect(await service.changeUserEmail(emailDto)).toBe(result);
});
it('email already used, should be not acceptable issue', async () => {
const result: HttpException = new HttpException('Email already used', HttpStatus.NOT_ACCEPTABLE);
const emailDto: EmailChangeDto = { newEmail: 'jacques.dupont@mii.com', oldEmail: 'jacques.dupont@mii.com' }; //NOSONAR
jest.spyOn(service, 'changeUserEmail').mockImplementation(async (): Promise<any> => result);
expect(await service.changeUserEmail(emailDto)).toBe(result);
});
it('should change email', async () => {
const result = {
validationToken: '',
emailVerified: true,
email: 'test.dupont@mail.com',
password: hashPassword(),
role: 0,
newEmail: '',
resetPasswordToken: '',
changeEmailToken: '',
structuresLink: [],
pendingStructuresLink: [],
structureOutdatedMailSent: [],
personalOffers: [],
name: 'Jacques',
surname: 'Dupont',
phone: '06 06 06 06 06',
createdAt: new Date('2022-05-25T09:48:28.824Z'),
employer: {
name: 'test',
validated: true,
},
job: {
name: 'test',
validated: true,
hasPersonalOffer: false,
},
unattachedSince: null,
};
const token =
'9bb3542bdc5ca8801ad4cee00403c1052bc95dee768dcbb65b1f719870578ed79f71f52fdc3e6bf02fd200a72b8b6f56fc26950df30c8cd7e427a485f80181b9'; //NOSONAR
jest.spyOn(service, 'verifyAndUpdateUserEmail').mockImplementation(async (): Promise<User> => result);
expect(await service.verifyAndUpdateUserEmail(token)).toBe(result);
});
it('should not change email', async () => {
const result: HttpException = new HttpException('Invalid token', HttpStatus.UNAUTHORIZED);
const token = '9bb3542bdc5ca8801aa72b8b6f56fc26950df30c8cd7e427a485f80181b9FAKETOKEN'; //NOSONAR
jest.spyOn(service, 'verifyAndUpdateUserEmail').mockImplementation(async (): Promise<any> => result);
expect(await service.verifyAndUpdateUserEmail(token)).toBe(result);
});
// TODO implement correct tests
});
describe('sendResetPasswordEmail', () => {
it('should not send email', async () => {
const result = new HttpException('Email sent if account exist', HttpStatus.OK);
jest.spyOn(service, 'sendResetPasswordEmail').mockImplementation(async (): Promise<HttpException> => result);
expect(await service.sendResetPasswordEmail('test@mii.com')).toBe(result);
});
it('should send email', async () => {
const result = new HttpException('Email sent if account exist', HttpStatus.OK);
jest.spyOn(service, 'sendResetPasswordEmail').mockImplementation(async (): Promise<HttpException> => result);
expect(await service.sendResetPasswordEmail('test@mii.com')).toBe(result);
});
// TODO implement correct tests
});
describe('validatePasswordResetToken', () => {
it('should not validate new password: token does`nt exist', async () => {
const result = new HttpException('Invalid token', HttpStatus.UNAUTHORIZED);
jest.spyOn(service, 'validatePasswordResetToken').mockImplementation(async (): Promise<HttpException> => result);
expect(
await service.validatePasswordResetToken(
'test@mii.com',
'5def4cb41106f89c212679e164911776618bd529e4f78e2883f7dd01776612a1b4a2ad7edabf2a3e3638aa605966c7a4b69d5f07d9617334e58332ba5f9305'
)
).toBe(result);
});
it('should not validate new password: weak password', async () => {
const result = new HttpException(
'Weak password, it must contain one lowercase alphabetical character, one uppercase alphabetical character, one numeric character, one special character and be eight characters or longer',
HttpStatus.UNPROCESSABLE_ENTITY
);
jest.spyOn(service, 'validatePasswordResetToken').mockImplementation(async (): Promise<HttpException> => result);
expect(
await service.validatePasswordResetToken(
'test@mii.com',
'5def4cb41106f89c212679e164911776618bd529e4f78e2883f7dd01776612a1b4a2ad7edabf2a3e3638aa605966c7a4b69d5f07d9617334e58332ba5f9305a6'
)
).toBe(result);
});
it('should validate new password', async () => {
const result = new HttpException('Password Reset', HttpStatus.OK);
jest.spyOn(service, 'validatePasswordResetToken').mockImplementation(async (): Promise<HttpException> => result);
expect(
await service.validatePasswordResetToken(
'test@mii.com',
'5def4cb41106f89c212679e164911776618bd529e4f78e2883f7dd01776612a1b4a2ad7edabf2a3e3638aa605966c7a4b69d5f07d9617334e58332ba5f9305a6'
)
).toBe(result);
});
it('should return structureLink tab ', async () => {
const result = [53];
jest.spyOn(service, 'updateStructureLinked').mockImplementation(async (): Promise<any> => result);
expect(await service.updateStructureLinked('test@mii.com', '6001a37716b08100062e4160')).toBe(result);
});
it('should return invalid User ', async () => {
const result = new HttpException('Invalid user', HttpStatus.NOT_FOUND);
jest.spyOn(service, 'updateStructureLinked').mockImplementation(async (): Promise<any> => result);
expect(await service.updateStructureLinked('test@mii.com', '6001a37716b08100062e4160')).toBe(result);
});
// TODO implement correct tests
});
it('should find All Unattacheduser', async () => {
......
......@@ -41,7 +41,7 @@ export class UsersService {
* Create a user account
* @param createUserDto CreateUserDto
*/
public async create(createUserDto: CreateUserDto): Promise<User | HttpStatus> {
public async create(createUserDto: CreateUserDto): Promise<IUser> {
const userInDb = await this.findOne(createUserDto.email);
if (userInDb) {
throw new HttpException('User already exists', HttpStatus.BAD_REQUEST);
......@@ -52,7 +52,7 @@ export class UsersService {
HttpStatus.UNPROCESSABLE_ENTITY
);
}
let createUser = new this.userModel(createUserDto);
let createUser = new this.userModel(createUserDto) as IUser;
createUser.surname = createUser.surname.toUpperCase();
createUser.structuresLink = [];
if (createUserDto.structuresLink) {
......@@ -177,6 +177,7 @@ export class UsersService {
* Use for login action
* @param param LoginDto
*/
// TODO update method name
public async findByLogin({ email, password }: LoginDto): Promise<User> {
const user = await this.findOne(email, true);
......@@ -199,7 +200,7 @@ export class UsersService {
* a new account.
* @param user User
*/
private async verifyUserMail(user: IUser): Promise<any> {
private async verifyUserMail(user: IUser): Promise<IUser> {
const config = this.mailerService.config;
const ejsPath = this.mailerService.getTemplateLocation(config.templates.verify.ejs);
const jsonConfig = this.mailerService.loadJsonConfig(config.templates.verify.json);
......@@ -223,7 +224,7 @@ export class UsersService {
public async sendAdminApticStructureMail(
structureName: string,
duplicatedStructure: StructureDocument
): Promise<any> {
): Promise<void> {
const config = this.mailerService.config;
const ejsPath = this.mailerService.getTemplateLocation(config.templates.apticStructureDuplication.ejs);
const jsonConfig = this.mailerService.loadJsonConfig(config.templates.apticStructureDuplication.json);
......@@ -243,7 +244,7 @@ export class UsersService {
/**
* Send to all admins mail for aptic duplicated data
*/
public async sendAdminApticNewStructureMail(structure: StructureDocument): Promise<any> {
public async sendAdminApticNewStructureMail(structure: StructureDocument): Promise<void> {
const config = this.mailerService.config;
const ejsPath = this.mailerService.getTemplateLocation(config.templates.newApticStructure.ejs);
const jsonConfig = this.mailerService.loadJsonConfig(config.templates.newApticStructure.json);
......@@ -263,9 +264,8 @@ export class UsersService {
/**
* Send approval email for user
* a new account.
* @param user User
*/
public async sendStructureClaimApproval(userEmail: string, structureName: string, status: boolean): Promise<any> {
public async sendStructureClaimApproval(userEmail: string, structureName: string, status: boolean): Promise<void> {
const config = this.mailerService.config;
const ejsPath = this.mailerService.getTemplateLocation(config.templates.structureClaimValidation.ejs);
const jsonConfig = this.mailerService.loadJsonConfig(config.templates.structureClaimValidation.json);
......@@ -297,7 +297,7 @@ export class UsersService {
}
}
public async changeUserEmail(emailDto: EmailChangeDto): Promise<any> {
public async changeUserEmail(emailDto: EmailChangeDto): Promise<IUser> {
const user = await this.findOne(emailDto.oldEmail);
const alreadyUsed = await this.findOne(emailDto.newEmail);
if (user) {
......@@ -321,7 +321,7 @@ export class UsersService {
throw new HttpException('Email sent if account exist', HttpStatus.UNAUTHORIZED);
}
public async verifyAndUpdateUserEmail(token: string): Promise<any> {
public async verifyAndUpdateUserEmail(token: string): Promise<IUser> {
const user = await this.userModel.findOne({ changeEmailToken: token }).exec();
if (user) {
user.email = user.newEmail;
......@@ -334,7 +334,7 @@ export class UsersService {
}
}
public async changeUserPassword(userId: string, oldPassword: string, newPassword: string): Promise<any> {
public async changeUserPassword(userId: string, oldPassword: string, newPassword: string): Promise<void> {
const user = await this.findById(userId, true);
const arePasswordEqual = await this.comparePassword(oldPassword, user.password);
if (!arePasswordEqual) {
......@@ -354,7 +354,7 @@ export class UsersService {
* Send reset password email based on ejs template
* @param email string
*/
public async sendResetPasswordEmail(email: string): Promise<HttpException> {
public async sendResetPasswordEmail(email: string): Promise<void> {
const user = await this.findOne(email);
if (user) {
const config = this.mailerService.config;
......@@ -381,7 +381,7 @@ export class UsersService {
* @param password string
* @param token string
*/
public async validatePasswordResetToken(password: string, token: string): Promise<HttpException> {
public async validatePasswordResetToken(password: string, token: string): Promise<void> {
const user = await this.userModel.findOne({ resetPasswordToken: token }).exec();
if (user) {
if (!this.isStrongPassword(password)) {
......@@ -436,7 +436,7 @@ export class UsersService {
return this.userModel.find({ employer: employerId._id }).select('-password -employer').exec();
}
public async populateJobswithUsers(jobs: JobDocument[]): Promise<any[]> {
public async populateJobswithUsers(jobs: JobDocument[]) {
return Promise.all(
jobs.map(async (job) => {
return {
......@@ -450,7 +450,7 @@ export class UsersService {
);
}
public async populateEmployerswithUsers(employers: EmployerDocument[]): Promise<any[]> {
public async populateEmployerswithUsers(employers: EmployerDocument[]) {
return Promise.all(
employers.map(async (employer) => {
return {
......@@ -479,7 +479,7 @@ export class UsersService {
* Send to all admins validation email for structures
* new account.
*/
private async sendAdminStructureValidationMail(userEmail: string, structure: StructureDocument): Promise<any> {
private async sendAdminStructureValidationMail(userEmail: string, structure: StructureDocument): Promise<void> {
const config = this.mailerService.config;
const ejsPath = this.mailerService.getTemplateLocation(config.templates.adminStructureClaim.ejs);
const jsonConfig = this.mailerService.loadJsonConfig(config.templates.adminStructureClaim.json);
......@@ -802,7 +802,7 @@ export class UsersService {
* @param employer
* @param job
*/
public async updateUserProfile(userId: Types.ObjectId, employer: EmployerDocument, job: JobDocument): Promise<any> {
public async updateUserProfile(userId: Types.ObjectId, employer: EmployerDocument, job: JobDocument): Promise<IUser> {
this.logger.debug(`updateUserProfile | ${userId}`);
const updated = await this.userModel.findByIdAndUpdate(
{ _id: userId },
......@@ -820,7 +820,7 @@ export class UsersService {
* @param job
* @param userId
*/
public async updateUserJob(userId: Types.ObjectId, job: JobDocument): Promise<any> {
public async updateUserJob(userId: Types.ObjectId, job: JobDocument): Promise<IUser> {
this.logger.debug(`updateUserProfile - Job | ${userId}`);
const updated = await this.userModel.findByIdAndUpdate({ _id: userId }, { $set: { job: job._id } });
if (updated) {
......@@ -835,7 +835,7 @@ export class UsersService {
* @param employer
* @param userId
*/
public async updateUserEmployer(userId: Types.ObjectId, employer: EmployerDocument): Promise<any> {
public async updateUserEmployer(userId: Types.ObjectId, employer: EmployerDocument): Promise<IUser> {
this.logger.debug(`updateUserProfile - Employer | ${userId}`);
const updated = await this.userModel.findByIdAndUpdate({ _id: userId }, { $set: { employer: employer._id } });
if (updated) {
......
......@@ -66,7 +66,7 @@ export const structuresDocumentDataMock: StructureDocument[] = [
nbTablets: 1,
nbNumericTerminal: 1,
nbScanners: 1,
freeWorkShop: false,
freeWorkShop: 'Non',
accountVerified: true,
personalOffers: [],
createdAt: '2021-05-06T09:42:38.000Z',
......@@ -143,7 +143,7 @@ export const structuresDocumentDataMock: StructureDocument[] = [
nbTablets: 1,
nbNumericTerminal: 1,
nbScanners: 1,
freeWorkShop: false,
freeWorkShop: 'Non',
accountVerified: true,
personalOffers: [
{
......@@ -226,7 +226,7 @@ export const structureMockDto: StructureDto = {
nbComputers: 1,
nbPrinters: 1,
nbScanners: 1,
freeWorkShop: false,
freeWorkShop: 'Non',
accountVerified: true,
personalOffers: [],
createdAt: new Date(),
......
import { StructureDocument } from '../../../src/structures/schemas/structure.schema';
export class StructuresForSearchServiceMock {
findAll() {
return [
......@@ -101,7 +103,7 @@ export class StructuresForSearchServiceMock {
},
nbScanners: 1,
description: "Notre rôle est de faciliter l'accès des personnes aux services nécessaires à la vie quotidienne",
},
];
} as any,
] as StructureDocument[];
}
}
......@@ -103,7 +103,7 @@ export class StructuresServiceMock {
nbComputers: 1,
nbPrinters: 1,
nbScanners: 1,
freeWorkShop: false,
freeWorkShop: 'Non',
accountVerified: true,
createdAt: new Date('2021-05-06T09:42:38.000Z'),
updatedAt: new Date('2021-05-06T09:42:38.000Z'),
......@@ -154,7 +154,7 @@ export class StructuresServiceMock {
handicaps: ['physicalDisability'],
publicOthers: ['uniquementFemmes'],
},
freeWorkShop: false,
freeWorkShop: 'Non',
createdAt: new Date('2020-11-16T09:30:00.000Z'),
updatedAt: new Date('2020-11-16T09:30:00.000Z'),
structureName: "L'Atelier Numérique",
......@@ -309,7 +309,7 @@ export class StructuresServiceMock {
handicaps: ['physicalDisability'],
publicOthers: ['uniquementFemmes'],
},
freeWorkShop: false,
freeWorkShop: 'Non',
createdAt: new Date('2020-11-16T09:30:00.000Z'),
updatedAt: new Date('2020-11-16T09:30:00.000Z'),
structureName: "L'Atelier Numérique",
......@@ -518,7 +518,7 @@ export class StructuresServiceMock {
nbComputers: 1,
nbPrinters: 1,
nbScanners: 1,
freeWorkShop: false,
freeWorkShop: 'Non',
accountVerified: true,
createdAt: new Date('2021-05-06T09:42:38.000Z'),
updatedAt: new Date('2021-05-06T09:42:50.000Z'),
......@@ -620,7 +620,7 @@ export class StructuresServiceMock {
nbComputers: 1,
nbPrinters: 1,
nbScanners: 1,
freeWorkShop: false,
freeWorkShop: 'Non',
accountVerified: true,
createdAt: new Date('2021-05-06T09:42:38.000Z'),
updatedAt: new Date('2021-05-06T09:42:50.000Z'),
......@@ -727,7 +727,7 @@ export class StructuresServiceMock {
nbComputers: 1,
nbPrinters: 1,
nbScanners: 1,
freeWorkShop: false,
freeWorkShop: 'Non',
accountVerified: true,
createdAt: new Date('2021-05-06T09:42:38.000Z'),
updatedAt: new Date('2021-05-06T09:42:50.000Z'),
......@@ -829,7 +829,7 @@ export class StructuresServiceMock {
nbComputers: 1,
nbPrinters: 1,
nbScanners: 1,
freeWorkShop: false,
freeWorkShop: 'Non',
accountVerified: true,
createdAt: new Date('2021-05-06T09:42:38.000Z'),
updatedAt: new Date('2021-05-06T09:42:50.000Z'),
......@@ -936,7 +936,7 @@ export class StructuresServiceMock {
nbComputers: 1,
nbPrinters: 1,
nbScanners: 1,
freeWorkShop: false,
freeWorkShop: 'Non',
accountVerified: true,
personalOffers: [],
dataShareConsentDate: '2022-03-01T09:00:00.000Z',
......@@ -1040,7 +1040,7 @@ export class StructuresServiceMock {
nbComputers: 1,
nbPrinters: 1,
nbScanners: 1,
freeWorkShop: false,
freeWorkShop: 'Non',
accountVerified: true,
personalOffers: [],
dataShareConsentDate: '2022-03-01T09:00:00.000Z',
......@@ -1121,7 +1121,7 @@ export class StructuresServiceMock {
nbTablets: 1,
nbNumericTerminal: 1,
nbScanners: 1,
freeWorkShop: false,
freeWorkShop: 'Non',
accountVerified: true,
createdAt: new Date('2021-05-06T09:42:38.000Z'),
updatedAt: new Date('2021-05-06T09:42:50.000Z'),
......@@ -1266,7 +1266,9 @@ export class StructuresServiceMock {
export const mockCNFSStructures: Array<CNFSStructure> = [
{
id: '62866838cdc04606eb14ee90',
structureId: '62866838cdc04606eb14ee90',
nom: 'Centre social de Brignais',
prise_rdv: 'https://www.rdv-aide-numerique.fr/org/100000',
commune: 'BRIGNAIS',
code_postal: '69530',
adresse: '28 BD DE SCHWEIGHOUSE',
......@@ -1287,7 +1289,9 @@ export const mockCNFSStructures: Array<CNFSStructure> = [
},
{
id: '62866909cdc04606eb14ee95',
structureId: '62866909cdc04606eb14ee95',
nom: 'Plateforme Emploi et Cohésion Sociale',
prise_rdv: 'https://www.rdv-aide-numerique.fr/org/100000',
commune: 'BRIGNAIS',
code_postal: '69530',
adresse: '24 Rue des Jardins',
......@@ -1305,8 +1309,10 @@ export const mockCNFSStructures: Array<CNFSStructure> = [
},
{
id: '62872e94cdc04606eb14ef09',
structureId: '62872e94cdc04606eb14ef09',
nom: 'Communauté de Communes du Chemin des Dames',
commune: 'CRAONNE',
prise_rdv: 'https://www.rdv-aide-numerique.fr/org/100000',
// Wrong CP
code_postal: '02160',
adresse: "1 RUE DE L'EGLISE",
......@@ -1324,8 +1330,10 @@ export const mockCNFSStructures: Array<CNFSStructure> = [
},
{
id: '62866838cdc04606eb22ff11',
structureId: '62866838cdc04606eb22ff11',
nom: 'Pwet',
commune: 'BRIGNAIS',
prise_rdv: 'https://www.rdv-aide-numerique.fr/org/100000',
// Corect CP
code_postal: '69530',
adresse: '28 BD DE SCHWEIGHOUSE',
......