chore: fixes access control test
This commit is contained in:
@@ -100,7 +100,7 @@ describe('access control', () => {
|
|||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
existingDoc = await payload.create({
|
existingDoc = await payload.create({
|
||||||
collection: readOnlySlug,
|
collection: restrictedSlug,
|
||||||
data: {
|
data: {
|
||||||
name: 'name',
|
name: 'name',
|
||||||
},
|
},
|
||||||
@@ -135,7 +135,7 @@ describe('access control', () => {
|
|||||||
|
|
||||||
test('should not have access to existing doc', async () => {
|
test('should not have access to existing doc', async () => {
|
||||||
await page.goto(restrictedUrl.edit(existingDoc.id))
|
await page.goto(restrictedUrl.edit(existingDoc.id))
|
||||||
await expect(page.locator('.unauthorized')).toBeVisible()
|
await expect(page.locator('.not-found')).toBeVisible()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
10
test/dev.js
10
test/dev.js
@@ -1,5 +1,4 @@
|
|||||||
import minimist from 'minimist'
|
import minimist from 'minimist'
|
||||||
import { MongoMemoryReplSet } from 'mongodb-memory-server'
|
|
||||||
import { nextDev } from 'next/dist/cli/next-dev.js'
|
import { nextDev } from 'next/dist/cli/next-dev.js'
|
||||||
import open from 'open'
|
import open from 'open'
|
||||||
import { getNextJSRootDir } from './helpers/getNextJSRootDir.js'
|
import { getNextJSRootDir } from './helpers/getNextJSRootDir.js'
|
||||||
@@ -29,15 +28,6 @@ if (args.o) {
|
|||||||
await open('http://localhost:3000/admin')
|
await open('http://localhost:3000/admin')
|
||||||
}
|
}
|
||||||
|
|
||||||
global._mongoMemoryServer = await MongoMemoryReplSet.create({
|
|
||||||
replSet: {
|
|
||||||
count: 3,
|
|
||||||
dbName: 'payloadmemory',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
process.env.MONGODB_MEMORY_SERVER_URI = global._mongoMemoryServer.getUri()
|
|
||||||
|
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
await nextDev({ port: process.env.PORT || 3000, dirname: rootDir }, 'default', rootDir)
|
await nextDev({ port: process.env.PORT || 3000, dirname: rootDir }, 'default', rootDir)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user