Explorar el Código

create TopPage test

takeru0001 hace 5 años
padre
commit
ff46ebe4be
Se han modificado 1 ficheros con 21 adiciones y 0 borrados
  1. 21 0
      src/test/util/TopPage.test.js

+ 21 - 0
src/test/util/TopPage.test.js

@@ -0,0 +1,21 @@
+const { isTopPage } = require('../../lib/util/path-utils');
+
+
+describe('TopPage Path test', () => {
+  test('Path is only "/"', () => {
+    const result = isTopPage('/');
+    expect(result).toBe(true);
+  });
+  test('Path is not match string ', () => {
+    const result = isTopPage('/test');
+    expect(result).toBe(false);
+  });
+  test('Path is integer', () => {
+    const result = isTopPage(1);
+    expect(result).toBe(false);
+  });
+  test('Path is null', () => {
+    const result = isTopPage(null);
+    expect(result).toBe(false);
+  });
+});