Skip to content

Commit

Permalink
fix: tests unitaires backend
Browse files Browse the repository at this point in the history
  • Loading branch information
pYassine committed Aug 20, 2021
1 parent 6369f18 commit e0cda3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("Structure Creator Service", () => {
expect(service).toBeDefined();
});

it("check token", async (done) => {
it("check token", async () => {
const structureId = 2;
const token =
"adfbfe24ff6de1f4e7c0011ad05028f5a129ced7f120079d20c4adf21d89";
Expand All @@ -40,6 +40,5 @@ describe("Structure Creator Service", () => {
expect(structure.id).toEqual(2);
const structure2 = await service.checkCreationToken({ structureId, token });
expect(structure2).toBeUndefined(); // token has been clear
done();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe("Import Controller", () => {
expect(controller).toBeDefined();
});

it(`❌ Import d'un fichier Incorrect`, async (done) => {
it(`❌ Import d'un fichier Incorrect`, async () => {
const importFilePath = path.resolve(importFilesDir, "import_ko_1.xlsx");

expect(fs.existsSync(importFilePath)).toBeTruthy();
Expand All @@ -72,10 +72,9 @@ describe("Import Controller", () => {
.expect(400);

expect(response.status).toBe(HttpStatus.BAD_REQUEST);
done();
});

it(`✅ Import d'un fichier Valide 1️⃣`, async (done) => {
it(`✅ Import d'un fichier Valide 1️⃣`, async () => {
const importFilePath = path.resolve(importFilesDir, "import_ok_1.xlsx");

expect(fs.existsSync(importFilePath)).toBeTruthy();
Expand All @@ -97,10 +96,9 @@ describe("Import Controller", () => {
totalCount: 0,
},
});
done();
});

it(`✅ Import d'un fichier Valide 2️⃣`, async (done) => {
it(`✅ Import d'un fichier Valide 2️⃣`, async () => {
const importFilePath = path.resolve(importFilesDir, "import_ok_2.xlsx");

expect(fs.existsSync(importFilePath)).toBeTruthy();
Expand All @@ -122,9 +120,8 @@ describe("Import Controller", () => {
totalCount: 0,
},
});
done();
});

// TODO: ajouter les test de taille limite
// TODO: vérufier le résultat dans la BDD
// TODO: vérifier le résultat dans la BDD
});

0 comments on commit e0cda3a

Please sign in to comment.