Skip to content

Commit

Permalink
Fix authz admin E2E test
Browse files Browse the repository at this point in the history
  • Loading branch information
wcalderipe committed Feb 19, 2024
1 parent bc5d782 commit fd8756a
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions apps/authz/src/app/__test__/e2e/admin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { readFileSync, unlinkSync } from 'fs'
import { mock } from 'jest-mock-extended'
import request from 'supertest'
import { AppModule } from '../../../app/app.module'
import { PersistenceModule } from '../../../shared/module/persistence/persistence.module'
import { TestPrismaService } from '../../../shared/module/persistence/service/test-prisma.service'
import { Organization } from '../../../shared/types/entities.types'
import { Criterion, Then, TimeWindow } from '../../../shared/types/policy.type'
import { load } from '../../app.config'
Expand All @@ -18,7 +16,6 @@ const REQUEST_HEADER_ORG_ID = 'x-org-id'
describe('Admin Endpoints', () => {
let app: INestApplication
let module: TestingModule
let testPrismaService: TestPrismaService

// TODO: Real sigs; these will NOT match the test data.
const authentication: Signature = {
Expand Down Expand Up @@ -54,35 +51,23 @@ describe('Admin Endpoints', () => {
load: [load],
isGlobal: true
}),
PersistenceModule,
AppModule
]
})
.overrideProvider(EntityRepository)
.useValue(entityRepositoryMock)
.compile()

testPrismaService = module.get<TestPrismaService>(TestPrismaService)

app = module.createNestApplication()

await app.init()
})

afterAll(async () => {
await testPrismaService.truncateAll()
await module.close()
await app.close()
})

beforeEach(async () => {
await testPrismaService.getClient().organization.create({ data: org })
})

afterEach(async () => {
await testPrismaService.truncateAll()
})

describe('POST /policies', () => {
it('sets the organization policies', async () => {
const payload = {
Expand Down

0 comments on commit fd8756a

Please sign in to comment.