fix: Move default country loading for region to the loader, fix a bug with cascade (#6559)
This commit is contained in:
@@ -40,13 +40,13 @@ describe("API Keys - Admin", () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await createAdminUser(dbConnection, adminHeaders)
|
||||
|
||||
// Used for testing cross-module authentication checks
|
||||
await regionService.createDefaultCountries()
|
||||
})
|
||||
|
||||
afterEach(async () => {
|
||||
const db = useDb()
|
||||
// TODO: Once teardown doesn't skip constraint checks and cascades, we can remove this
|
||||
const existingRegions = await regionService.list({})
|
||||
await regionService.delete(existingRegions.map((r) => r.id))
|
||||
await db.teardown()
|
||||
})
|
||||
|
||||
|
||||
@@ -63,7 +63,6 @@ describe("Carts workflows", () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await adminSeeder(dbConnection)
|
||||
await regionModuleService.createDefaultCountries()
|
||||
|
||||
// Here, so we don't have to create a region for each test
|
||||
defaultRegion = await regionModuleService.create({
|
||||
|
||||
@@ -59,7 +59,6 @@ describe("Store Carts API", () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await adminSeeder(dbConnection)
|
||||
await regionModuleService.createDefaultCountries()
|
||||
|
||||
// Here, so we don't have to create a region for each test
|
||||
defaultRegion = await regionModuleService.create({
|
||||
|
||||
@@ -47,11 +47,6 @@ describe("Cart links", () => {
|
||||
await shutdownServer()
|
||||
})
|
||||
|
||||
beforeEach(async () => {
|
||||
// @ts-ignore
|
||||
await regionModule.createDefaultCountries()
|
||||
})
|
||||
|
||||
afterEach(async () => {
|
||||
const db = useDb()
|
||||
await db.teardown()
|
||||
|
||||
@@ -33,11 +33,6 @@ describe("Link: Cart Region", () => {
|
||||
await shutdownServer()
|
||||
})
|
||||
|
||||
beforeEach(async () => {
|
||||
// @ts-ignore
|
||||
await regionModule.createDefaultCountries()
|
||||
})
|
||||
|
||||
afterEach(async () => {
|
||||
const db = useDb()
|
||||
await db.teardown()
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
|
||||
|
||||
@@ -37,9 +37,6 @@ describe("Store - Admin", () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await createAdminUser(dbConnection, adminHeaders)
|
||||
|
||||
const existingStores = await service.list({})
|
||||
await service.delete(existingStores.map((s) => s.id))
|
||||
})
|
||||
|
||||
afterEach(async () => {
|
||||
|
||||
Reference in New Issue
Block a user