Skip to content

Commit

Permalink
fix: add default value for map layer (#3829)
Browse files Browse the repository at this point in the history
* fix: add default value for map layer

* fix: remove test clutter
  • Loading branch information
ludtkemorgan authored Jan 25, 2024
1 parent 6fe5374 commit 27c13b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ export class addFeatureCollection1705637577495 implements MigrationInterface {
name = "addFeatureCollection1705637577495"

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "map_layers" ADD "feature_collection" jsonb NOT NULL`)
await queryRunner.query(
`ALTER TABLE "map_layers" ADD "feature_collection" jsonb NOT NULL default '{}'::jsonb`
)
}

public async down(queryRunner: QueryRunner): Promise<void> {
Expand Down
11 changes: 11 additions & 0 deletions sites/partners/__tests__/pages/settings/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ beforeAll(() => {
mockNextRouter()
})

beforeEach(() => {
server.use(
rest.get("http://localhost/api/adapter/mapLayers", (_req, res, ctx) => {
return res(ctx.json({}))
}),
rest.get("http://localhost:3100/mapLayers", (_req, res, ctx) => {
return res(ctx.json({}))
})
)
})

afterEach(() => server.resetHandlers())

afterAll(() => server.close())
Expand Down

0 comments on commit 27c13b6

Please sign in to comment.