fix: Move default country loading for region to the loader, fix a bug with cascade (#6559)

This commit is contained in:
Stevche Radevski
2024-03-01 14:58:55 +01:00
committed by GitHub
parent 56d97ebef9
commit 347aba719c
16 changed files with 87 additions and 121 deletions
@@ -36,12 +36,13 @@ describe("Regions - Admin", () => {
beforeEach(async () => {
await createAdminUser(dbConnection, adminHeaders)
await service.createDefaultCountries()
})
afterEach(async () => {
const db = useDb()
// TODO: Once teardown doesn't skip constraint checks and cascades, we can remove this
const existingRegions = await service.list({})
await service.delete(existingRegions.map((r) => r.id))
await db.teardown()
})