From 534a8822a0165184274f826d5682a2c0abf0ff93 Mon Sep 17 00:00:00 2001
From: Bastien DUMONT <bdumont@grandlyon.com>
Date: Wed, 1 Feb 2023 14:03:42 +0100
Subject: [PATCH] update tests

---
 __tests__/core/contractActivation.spec.js   | 10 +++++-----
 __tests__/core/contractVerification.spec.js | 14 +++++++-------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/__tests__/core/contractActivation.spec.js b/__tests__/core/contractActivation.spec.js
index e294d21..39bf05c 100644
--- a/__tests__/core/contractActivation.spec.js
+++ b/__tests__/core/contractActivation.spec.js
@@ -36,12 +36,12 @@ describe('activateContract', () => {
       )
       expect(serviceId).toBe(78232791)
     } catch (error) {
-      expect(error).toBe(errors.LOGIN_FAILED)
+      expect(error).toBe(errors.CAPTCHA_RESOLUTION_FAILED)
     }
 
     mockParseServiceId.mockRestore()
   })
-  it('should throw LOGIN_FAILED when request fail 🚫', async () => {
+  it('should throw CAPTCHA_RESOLUTION_FAILED when request fail 🚫', async () => {
     mockSoapRequest.mockRejectedValueOnce('reject')
     try {
       await activateContract(
@@ -56,12 +56,12 @@ describe('activateContract', () => {
       )
       expect(true).toBe(false)
     } catch (error) {
-      expect(error).toBe(errors.LOGIN_FAILED)
+      expect(error).toBe(errors.CAPTCHA_RESOLUTION_FAILED)
     }
 
     mockParseServiceId.mockRestore()
   })
-  it('should throw LOGIN_FAILED when failing parsing 🚫', async () => {
+  it('should throw CAPTCHA_RESOLUTION_FAILED when failing parsing 🚫', async () => {
     mockSoapRequest.mockResolvedValueOnce(responseMock)
     jest.spyOn(xml2js, 'parseStringPromise').mockResolvedValueOnce({
       Envelope: {
@@ -87,7 +87,7 @@ describe('activateContract', () => {
       )
       expect(true).toBe(false)
     } catch (error) {
-      expect(error).toBe(errors.LOGIN_FAILED)
+      expect(error).toBe(errors.CAPTCHA_RESOLUTION_FAILED)
     }
 
     mockParseServiceId.mockRestore()
diff --git a/__tests__/core/contractVerification.spec.js b/__tests__/core/contractVerification.spec.js
index 33b2ab7..9122851 100644
--- a/__tests__/core/contractVerification.spec.js
+++ b/__tests__/core/contractVerification.spec.js
@@ -74,7 +74,7 @@ describe('verifyContract', () => {
       )
       expect(serviceId).toBe(78232791)
     } catch (error) {
-      expect(error).toBe(errors.LOGIN_FAILED)
+      expect(error).toBe(errors.CAPTCHA_RESOLUTION_FAILED)
     }
 
     mockParseContracts.mockRestore()
@@ -126,7 +126,7 @@ describe('verifyContract', () => {
       )
       expect(serviceId).toBe(78232791)
     } catch (error) {
-      expect(error).toBe(errors.LOGIN_FAILED)
+      expect(error).toBe(errors.CAPTCHA_RESOLUTION_FAILED)
     }
 
     mockParseContracts.mockRestore()
@@ -186,12 +186,12 @@ describe('verifyContract', () => {
       )
       expect(serviceId).toBe(null)
     } catch (error) {
-      expect(error).toBe(errors.LOGIN_FAILED)
+      expect(error).toBe(errors.CAPTCHA_RESOLUTION_FAILED)
     }
 
     mockParseContracts.mockRestore()
   })
-  it('should return LOGIN_FAILED if issue in request 🚫', async () => {
+  it('should return CAPTCHA_RESOLUTION_FAILED if issue in request 🚫', async () => {
     mockSoapRequest.mockRejectedValueOnce('reject')
 
     try {
@@ -204,10 +204,10 @@ describe('verifyContract', () => {
       )
       expect(true).toBe(false)
     } catch (error) {
-      expect(error).toBe(errors.LOGIN_FAILED)
+      expect(error).toBe(errors.CAPTCHA_RESOLUTION_FAILED)
     }
   })
-  it('should return LOGIN_FAILED if issue in parsing 🚫', async () => {
+  it('should return CAPTCHA_RESOLUTION_FAILED if issue in parsing 🚫', async () => {
     mockSoapRequest.mockResolvedValue(responseMock)
     jest.spyOn(xml2js, 'parseStringPromise').mockResolvedValueOnce({
       Envelope: {
@@ -229,7 +229,7 @@ describe('verifyContract', () => {
       )
       expect(true).toBe(false)
     } catch (error) {
-      expect(error).toBe(errors.LOGIN_FAILED)
+      expect(error).toBe(errors.CAPTCHA_RESOLUTION_FAILED)
     }
   })
   it('should return NULL if no contract are found 🚫', async () => {
-- 
GitLab