Prechádzať zdrojové kódy

add integration test

Shun Miyazawa 2 rokov pred
rodič
commit
287a53e6c1

+ 16 - 1
apps/app/test/integration/models/user.test.js

@@ -73,7 +73,6 @@ describe('User', () => {
         expect(user).toBeInstanceOf(User);
         expect(user.name).toBe('Example for User Test');
       });
-
     });
 
   });
@@ -135,5 +134,21 @@ describe('User', () => {
         expect(username).toBeNull();
       });
     });
+
+    describe('Get user exists from user page path', () => {
+      test('found', async() => {
+        const userPagePath = '/user/usertest';
+        const isExist = await User.isExistUserByUserPagePath(userPagePath);
+
+        expect(isExist).toBe(true);
+      });
+
+      test('not found', async() => {
+        const userPagePath = '/user/usertest2';
+        const isExist = await User.isExistUserByUserPagePath(userPagePath);
+
+        expect(isExist).toBe(false);
+      });
+    });
   });
 });