Explorar o código

add integration test

Shun Miyazawa %!s(int64=2) %!d(string=hai) anos
pai
achega
287a53e6c1
Modificáronse 1 ficheiros con 16 adicións e 1 borrados
  1. 16 1
      apps/app/test/integration/models/user.test.js

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

@@ -73,7 +73,6 @@ describe('User', () => {
         expect(user).toBeInstanceOf(User);
         expect(user).toBeInstanceOf(User);
         expect(user.name).toBe('Example for User Test');
         expect(user.name).toBe('Example for User Test');
       });
       });
-
     });
     });
 
 
   });
   });
@@ -135,5 +134,21 @@ describe('User', () => {
         expect(username).toBeNull();
         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);
+      });
+    });
   });
   });
 });
 });