浏览代码

fix(syncing-server): error log on email backup request handler

Karol Sójko 1 年之前
父节点
当前提交
702a1286eb

+ 1 - 1
packages/syncing-server/src/Domain/Handler/EmailBackupRequestedEventHandler.ts

@@ -47,7 +47,7 @@ export class EmailBackupRequestedEventHandler implements DomainEventHandlerInter
         authenticated: false,
       })
     } catch (error) {
-      this.logger.warn(`Could not get user key params from auth service: ${(error as Error).message}`)
+      this.logger.error(`Could not get user key params from auth service: ${JSON.stringify(error)}`)
 
       return
     }

+ 0 - 38
packages/syncing-server/src/Infra/HTTP/AuthHttpService.spec.ts

@@ -1,38 +0,0 @@
-import 'reflect-metadata'
-
-import { AxiosInstance } from 'axios'
-
-import { AuthHttpService } from './AuthHttpService'
-
-describe('AuthHttpService', () => {
-  let httpClient: AxiosInstance
-
-  const authServerUrl = 'https://auth-server'
-
-  const createService = () => new AuthHttpService(httpClient, authServerUrl)
-
-  beforeEach(() => {
-    httpClient = {} as jest.Mocked<AxiosInstance>
-    httpClient.request = jest.fn().mockReturnValue({ data: { foo: 'bar' } })
-  })
-
-  it('should send a request to auth service in order to get user key params', async () => {
-    await createService().getUserKeyParams({
-      email: 'test@test.com',
-      authenticated: false,
-    })
-
-    expect(httpClient.request).toHaveBeenCalledWith({
-      method: 'GET',
-      headers: {
-        Accept: 'application/json',
-      },
-      url: 'https://auth-server/users/params',
-      params: {
-        authenticated: false,
-        email: 'test@test.com',
-      },
-      validateStatus: expect.any(Function),
-    })
-  })
-})