Browse Source

add integration test

Shun Miyazawa 2 years ago
parent
commit
287a53e6c1
1 changed files with 16 additions and 1 deletions
  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);
+      });
+    });
   });
   });
 });
 });