Skip to content

Commit e98cada

Browse files
refactor: test setup uses region_type.json
1 parent ed97810 commit e98cada

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.jest/globalSetup.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import planter from '@seeds/data/planter.json';
88
import country from '@seeds/data/country.json';
99
import organization from '@seeds/data/organization.json';
1010
import token from '@seeds/data/token.json';
11+
import regionType from '@seeds/data/region_type.json';
1112
import knex, { TableNames } from 'infra/database/knex';
1213

1314
export default async function globalSetup() {
@@ -18,10 +19,7 @@ export default async function globalSetup() {
1819
await knex(TableNames.Species).insert(species);
1920
await knex(TableNames.Organizations).insert(organization);
2021
await knex(TableNames.Planters).insert(planter);
21-
await knex('region_type').insert({
22-
id: 6,
23-
type: 'country',
24-
});
22+
await knex(TableNames.RegionType).insert(regionType);
2523
await knex(TableNames.Countries).insert(country);
2624
}
2725
knex.destroy();

server/infra/database/knex.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ export const enum TableNames {
2929
Planters = 'planter',
3030
Organizations = 'entity',
3131
Countries = 'region',
32+
RegionType = 'region_type',
3233
}

0 commit comments

Comments
 (0)