mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 22:54:42 -04:00
fix(group): add special flag to create method
To make the create method more consistent with the guidelines, this commit adds the `special` flag to the parameters. As this function will only be used to create the two hard-coded groups and to handle API requests at one or two places, adding the parameter should not be too problematic. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
d0239f3a24
commit
178513a3a0
5 changed files with 18 additions and 12 deletions
|
@ -365,6 +365,7 @@ describe('NotesService', () => {
|
|||
const group = Group.create(
|
||||
groupPermissionUpate.groupname,
|
||||
groupPermissionUpate.groupname,
|
||||
false,
|
||||
) as Group;
|
||||
const note = Note.create(user) as Note;
|
||||
describe('works', () => {
|
||||
|
@ -668,7 +669,7 @@ describe('NotesService', () => {
|
|||
describe('toNotePermissionsDto', () => {
|
||||
it('works', async () => {
|
||||
const user = User.create('hardcoded', 'Testy') as User;
|
||||
const group = Group.create('testGroup', 'testGroup') as Group;
|
||||
const group = Group.create('testGroup', 'testGroup', false) as Group;
|
||||
const note = Note.create(user) as Note;
|
||||
note.userPermissions = [
|
||||
{
|
||||
|
@ -703,7 +704,7 @@ describe('NotesService', () => {
|
|||
const user = User.create('hardcoded', 'Testy') as User;
|
||||
const author = Author.create(1);
|
||||
author.user = user;
|
||||
const group = Group.create('testGroup', 'testGroup') as Group;
|
||||
const group = Group.create('testGroup', 'testGroup', false) as Group;
|
||||
const content = 'testContent';
|
||||
jest
|
||||
.spyOn(noteRepo, 'save')
|
||||
|
@ -800,7 +801,7 @@ describe('NotesService', () => {
|
|||
author.user = user;
|
||||
const otherUser = User.create('other hardcoded', 'Testy2') as User;
|
||||
otherUser.username = 'other hardcoded user';
|
||||
const group = Group.create('testGroup', 'testGroup') as Group;
|
||||
const group = Group.create('testGroup', 'testGroup', false) as Group;
|
||||
const content = 'testContent';
|
||||
jest
|
||||
.spyOn(noteRepo, 'save')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue