|
|
@@ -1,5 +1,3 @@
|
|
|
-import each from 'jest-each';
|
|
|
-
|
|
|
const { getInstance } = require('../setup-crowi');
|
|
|
|
|
|
describe('AclService test', () => {
|
|
|
@@ -165,17 +163,17 @@ describe('AclService test', () => {
|
|
|
expect(result).toBe(true);
|
|
|
});
|
|
|
|
|
|
- each`
|
|
|
- restrictGuestMode | expected
|
|
|
- ${undefined} | ${false}
|
|
|
- ${'Deny'} | ${false}
|
|
|
- ${'Readonly'} | ${true}
|
|
|
- ${'Open'} | ${false}
|
|
|
- ${'Restricted'} | ${false}
|
|
|
- ${'closed'} | ${false}
|
|
|
- `
|
|
|
- .test('to be $expected when FORCE_WIKI_MODE is undefined'
|
|
|
- + ' and `security:restrictGuestMode` is \'$restrictGuestMode\'', async({ restrictGuestMode, expected }) => {
|
|
|
+ /* eslint-disable indent */
|
|
|
+ describe.each`
|
|
|
+ restrictGuestMode | expected
|
|
|
+ ${undefined} | ${false}
|
|
|
+ ${'Deny'} | ${false}
|
|
|
+ ${'Readonly'} | ${true}
|
|
|
+ ${'Open'} | ${false}
|
|
|
+ ${'Restricted'} | ${false}
|
|
|
+ ${'closed'} | ${false}
|
|
|
+ `('to be $expected', ({ restrictGuestMode, expected }) => {
|
|
|
+ test(`when FORCE_WIKI_MODE is undefined and 'security:restrictGuestMode' is '${restrictGuestMode}`, async() => {
|
|
|
|
|
|
// reload
|
|
|
await crowi.configManager.loadConfigs();
|
|
|
@@ -198,6 +196,7 @@ describe('AclService test', () => {
|
|
|
expect(getConfigSpy).toHaveBeenCalledWith('crowi', 'security:restrictGuestMode');
|
|
|
expect(result).toBe(expected);
|
|
|
});
|
|
|
+ });
|
|
|
|
|
|
});
|
|
|
|