|
@@ -1,9 +1,9 @@
|
|
|
import {
|
|
import {
|
|
|
- isMovablePage, convertToNewAffiliationPath, isCreatablePage, omitDuplicateAreaPathFromPaths, getUsernameByPath,
|
|
|
|
|
|
|
+ isMovablePage, isTopPage, isUsersProtectedPages, convertToNewAffiliationPath, isCreatablePage, omitDuplicateAreaPathFromPaths, getUsernameByPath,
|
|
|
} from './index';
|
|
} from './index';
|
|
|
|
|
|
|
|
describe.concurrent('isMovablePage test', () => {
|
|
describe.concurrent('isMovablePage test', () => {
|
|
|
- test('should decide deletable or not', () => {
|
|
|
|
|
|
|
+ test('should decide movable or not', () => {
|
|
|
expect(isMovablePage('/')).toBeFalsy();
|
|
expect(isMovablePage('/')).toBeFalsy();
|
|
|
expect(isMovablePage('/hoge')).toBeTruthy();
|
|
expect(isMovablePage('/hoge')).toBeTruthy();
|
|
|
expect(isMovablePage('/user')).toBeFalsy();
|
|
expect(isMovablePage('/user')).toBeFalsy();
|
|
@@ -13,6 +13,24 @@ describe.concurrent('isMovablePage test', () => {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+describe.concurrent('isTopPage test', () => {
|
|
|
|
|
+ test('should decide deletable or not', () => {
|
|
|
|
|
+ expect(isTopPage('/')).toBeTruthy();
|
|
|
|
|
+ expect(isTopPage('/hoge')).toBeFalsy();
|
|
|
|
|
+ expect(isTopPage('/user/xxx/hoge')).toBeFalsy();
|
|
|
|
|
+ });
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+describe.concurrent('isUsersProtectedPages test', () => {
|
|
|
|
|
+ test('Should decide users protected pages or not', () => {
|
|
|
|
|
+ expect(isUsersProtectedPages('/hoge')).toBeFalsy();
|
|
|
|
|
+ expect(isUsersProtectedPages('/user')).toBeTruthy();
|
|
|
|
|
+ expect(isUsersProtectedPages('/user/xxx')).toBeTruthy();
|
|
|
|
|
+ expect(isUsersProtectedPages('/user/xxx123')).toBeTruthy();
|
|
|
|
|
+ expect(isUsersProtectedPages('/user/xxx/hoge')).toBeFalsy();
|
|
|
|
|
+ });
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
describe.concurrent('convertToNewAffiliationPath test', () => {
|
|
describe.concurrent('convertToNewAffiliationPath test', () => {
|
|
|
test.concurrent('Child path is not converted normally', () => {
|
|
test.concurrent('Child path is not converted normally', () => {
|
|
|
const result = convertToNewAffiliationPath('parent/', 'parent2/', 'parent/child');
|
|
const result = convertToNewAffiliationPath('parent/', 'parent2/', 'parent/child');
|