From 4c333d9be53d50e2d3c4d84d8e5637459971611e Mon Sep 17 00:00:00 2001 From: sergiomalv Date: Tue, 3 May 2022 11:43:10 +0200 Subject: [PATCH] Arreglo seguridad --- webapp/jest.config.ts | 3 ++- webapp/src/components/Order/Order.test.tsx | 4 ++-- webapp/vars.ts | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/webapp/jest.config.ts b/webapp/jest.config.ts index 29aed4e..f3fb388 100644 --- a/webapp/jest.config.ts +++ b/webapp/jest.config.ts @@ -3,5 +3,6 @@ export default { "\\.[jt]sx?$": "babel-jest", "^.+\\.tsx?$": "ts-jest", }, - collectCoverage: true + collectCoverage: true, + setupFiles: ['/vars.ts'] } \ No newline at end of file diff --git a/webapp/src/components/Order/Order.test.tsx b/webapp/src/components/Order/Order.test.tsx index 19da3f5..87f4b8c 100644 --- a/webapp/src/components/Order/Order.test.tsx +++ b/webapp/src/components/Order/Order.test.tsx @@ -9,8 +9,8 @@ jest.mock('../Services/OrderService'); test('check the payment form render properly', async () => { const user: User = { - username: "user", - password: "user", + username: process.env.USER2!, + password: process.env.USER2!, token: "" }; const product: Producto = { category: 'cellular', name: 'IPhone', description: 'a', urlImage: 'aaaaa', basePrice: 200, units: 2, onSale: true, IVA: 0.21 }; diff --git a/webapp/vars.ts b/webapp/vars.ts index bf95deb..68a9b9e 100644 --- a/webapp/vars.ts +++ b/webapp/vars.ts @@ -1,4 +1,6 @@ process.env.USER = 'pruebaprueba' process.env.PASS = 'PruebaPrueba1+' process.env.BADUSER = 'pru' -process.env.BADPASS = 'Prueb' \ No newline at end of file +process.env.BADPASS = 'Prueb' +process.env.USER2= 'user' +process.env.PASS2= 'user' \ No newline at end of file