chore: fixes access control test

This commit is contained in:
James
2024-04-08 22:25:35 -04:00
parent d3016b7eb5
commit c9399efa65
2 changed files with 2 additions and 12 deletions

View File

@@ -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()
}) })
}) })

View File

@@ -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)