From 35f5389fbb9cffa1cae4a9cfcd069f9927d92fec Mon Sep 17 00:00:00 2001 From: elszczepano Date: Mon, 24 Dec 2018 12:18:28 +0100 Subject: [PATCH] Delete all tests. Nedd to write it from scratch. --- __tests__/integration/auth/login.test.js | 9 ----- __tests__/integration/auth/register.test.js | 41 --------------------- __tests__/unit/auth/register.test.js | 23 ------------ 3 files changed, 73 deletions(-) delete mode 100644 __tests__/integration/auth/login.test.js delete mode 100644 __tests__/integration/auth/register.test.js delete mode 100644 __tests__/unit/auth/register.test.js diff --git a/__tests__/integration/auth/login.test.js b/__tests__/integration/auth/login.test.js deleted file mode 100644 index 783d9ec..0000000 --- a/__tests__/integration/auth/login.test.js +++ /dev/null @@ -1,9 +0,0 @@ -import API from '../../../testsConfig'; - -test('Check if user signed in correctly', () => { - API.post('login', { - email: "john@doe.com", - password: "secret123" - }).then(item => expect(item.response.data.success).toEqual(true)) - .catch(err => console.log(err)); -}); \ No newline at end of file diff --git a/__tests__/integration/auth/register.test.js b/__tests__/integration/auth/register.test.js deleted file mode 100644 index ba594a7..0000000 --- a/__tests__/integration/auth/register.test.js +++ /dev/null @@ -1,41 +0,0 @@ -import API from '../../../testsConfig'; - -test('Check if user signed up correctly', () => { - return API.post('register', { - name: "John", - phone: "123 456 789", - password: "secret123", - email: "john@doe.com", - gender: "male", - birthDate: "1992-12-04", - purpose: "Friends" - }).then(item => expect(item.data).toEqual({ - success: true, - message: "User registered successfully." - })) - .catch(err => console.log(err)); -}); - -test('Check if registry validation works correctly', () => { - return API.post('register', { - name: "", - phone: "", - password: "", - email: "", - gender: "", - birthDate: "", - purpose: "" - }).catch(item => expect(item.response.data.success).toEqual(false) && (item.response.data.errors.email.msg).toEqual("E-mail already in use")); -}); - -test('Check if user email validation works correctly', () => { - return API.post('register', { - name: "John", - phone: "123 456 789", - password: "secret123", - email: "john@doe.com", - gender: "male", - birthDate: "1992-12-04", - purpose: "Friends" - }).catch(item => expect(item.response.data.success).toEqual(false)); -}); \ No newline at end of file diff --git a/__tests__/unit/auth/register.test.js b/__tests__/unit/auth/register.test.js deleted file mode 100644 index e786ba9..0000000 --- a/__tests__/unit/auth/register.test.js +++ /dev/null @@ -1,23 +0,0 @@ -import authController from '../../../src/controllers/authController'; -import httpMocks from "node-mocks-http"; - - -test('Check if user signed up correctly', () => { - const req = httpMocks.createRequest({ - body: { - name: "Jane", - phone: "123 456 789", - password: "secret123", - email: "jane@doe.com", - gender: "female", - birthDate: "1992-12-04", - purpose: "Friends" - } - }); - const res = httpMocks.createResponse(); - authController.register(req, res).then(item => expect(item.data).toEqual({ - success: true, - message: "User registered successfully." - })) - .catch(err => console.log(err)); -}); \ No newline at end of file