mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-02-06 09:55:50 +00:00
Intermediate commit
This commit is contained in:
parent
303e1f399f
commit
f644507e4f
@ -10,14 +10,17 @@ let action
|
|||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
factory.create('User', { role: 'user', email: 'user@example.org', password: '1234' }),
|
factory.create('User', { role: 'user', email: 'user@example.org', password: '1234' }),
|
||||||
factory.create('User', { role: 'moderator', email: 'moderator@example.org', password: '1234' })
|
factory.create('User', { id: 'm1', role: 'moderator', email: 'moderator@example.org', password: '1234' })
|
||||||
])
|
])
|
||||||
await factory.authenticateAs({ email: 'user@example.org', password: '1234' })
|
await factory.authenticateAs({ email: 'user@example.org', password: '1234' })
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
factory.create('Post', { title: 'Deleted post', deleted: true, disabled: false }),
|
factory.create('Post', { title: 'Deleted post', deleted: true }),
|
||||||
factory.create('Post', { title: 'Disabled post', deleted: false, disabled: true }),
|
factory.create('Post', { id: 'p2', title: 'Disabled post', deleted: false }),
|
||||||
factory.create('Post', { title: 'Publicly visible post', deleted: false, disabled: false })
|
factory.create('Post', { title: 'Publicly visible post', deleted: false })
|
||||||
])
|
])
|
||||||
|
const moderatorFactory = Factory()
|
||||||
|
await moderatorFactory.authenticateAs({ email: 'moderator@example.org', password: '1234'})
|
||||||
|
await moderatorFactory.relate('Post', 'DisabledBy', { from: 'm1', to: 'p2'})
|
||||||
})
|
})
|
||||||
|
|
||||||
afterEach(async () => {
|
afterEach(async () => {
|
||||||
|
|||||||
@ -14,7 +14,6 @@ export default function (params) {
|
|||||||
].join('. '),
|
].join('. '),
|
||||||
image = faker.image.image(),
|
image = faker.image.image(),
|
||||||
visibility = 'public',
|
visibility = 'public',
|
||||||
disabled = false,
|
|
||||||
deleted = false
|
deleted = false
|
||||||
} = params
|
} = params
|
||||||
|
|
||||||
@ -26,7 +25,6 @@ export default function (params) {
|
|||||||
content: "${content}",
|
content: "${content}",
|
||||||
image: "${image}",
|
image: "${image}",
|
||||||
visibility: ${visibility},
|
visibility: ${visibility},
|
||||||
disabled: ${disabled},
|
|
||||||
deleted: ${deleted}
|
deleted: ${deleted}
|
||||||
) { title, content }
|
) { title, content }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,7 +87,7 @@ import Factory from './factories'
|
|||||||
asTrick.create('Post', { id: 'p4' }),
|
asTrick.create('Post', { id: 'p4' }),
|
||||||
asTrack.create('Post', { id: 'p5' }),
|
asTrack.create('Post', { id: 'p5' }),
|
||||||
asAdmin.create('Post', { id: 'p6' }),
|
asAdmin.create('Post', { id: 'p6' }),
|
||||||
asModerator.create('Post', { id: 'p7', disabled: true }),
|
asModerator.create('Post', { id: 'p7' }),
|
||||||
asUser.create('Post', { id: 'p8' }),
|
asUser.create('Post', { id: 'p8' }),
|
||||||
asTick.create('Post', { id: 'p9' }),
|
asTick.create('Post', { id: 'p9' }),
|
||||||
asTrick.create('Post', { id: 'p10' }),
|
asTrick.create('Post', { id: 'p10' }),
|
||||||
@ -98,6 +98,11 @@ import Factory from './factories'
|
|||||||
asTick.create('Post', { id: 'p15' })
|
asTick.create('Post', { id: 'p15' })
|
||||||
])
|
])
|
||||||
|
|
||||||
|
await asModerator.relate('Post', 'DisabledBy', {
|
||||||
|
from: 'u2',
|
||||||
|
to: 'p15'
|
||||||
|
})
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
f.relate('Post', 'Categories', { from: 'p0', to: 'cat16' }),
|
f.relate('Post', 'Categories', { from: 'p0', to: 'cat16' }),
|
||||||
f.relate('Post', 'Categories', { from: 'p1', to: 'cat1' }),
|
f.relate('Post', 'Categories', { from: 'p1', to: 'cat1' }),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user