* Fixed an issue with the moderation button not appearing on some posts. * Added some E2E tests to ensure moderation button is on posts for trusted users. * Added some more tests. * Added a test to ensure moderation button does not appear when logged out.
17 lines
656 B
JavaScript
17 lines
656 B
JavaScript
import { isModerationPage } from '@utilities/moderation';
|
|
|
|
describe('Moderation Utilities', () => {
|
|
it('should return true if on the moderation page', () => {
|
|
expect(isModerationPage('/mod')).toBe(true);
|
|
expect(isModerationPage('/mod/')).toBe(true);
|
|
});
|
|
|
|
it('should return false if the path contains part of the moderation page path', () => {
|
|
expect(isModerationPage('/some-user/moderate-post')).toBe(false);
|
|
expect(isModerationPage('/some-user/moderate-post/')).toBe(false);
|
|
});
|
|
|
|
it('should return false if the path is not the moderation page', () => {
|
|
expect(isModerationPage('/some-user/some-post')).toBe(false);
|
|
});
|
|
});
|