Skip to content

Commit

Permalink
Add sharedConfig to appModule
Browse files Browse the repository at this point in the history
  • Loading branch information
norda-gunni committed Sep 4, 2024
1 parent c8aeaa3 commit a3cb4f6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 20 deletions.
2 changes: 2 additions & 0 deletions apps/application-system/api/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import { VmstClientConfig } from '@island.is/clients/vmst'
import { FriggClientConfig } from '@island.is/clients/mms/frigg'
import { smsModuleConfig } from '@island.is/nova-sms'
import { emailModuleConfig } from '@island.is/email-service'
import { sharedModuleConfig } from '@island.is/application/template-api-modules'

@Module({
imports: [
Expand Down Expand Up @@ -115,6 +116,7 @@ import { emailModuleConfig } from '@island.is/email-service'
FriggClientConfig,
smsModuleConfig,
emailModuleConfig,
sharedModuleConfig,
],
}),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,15 @@ class MockContentfulRepository {
}
}

class MockSharedConfig {
load() {
return {
jwtSecret: 'supersecret',
clientLocationOrigin: 'http://localhost:4200',
email: {
sender: 'Devland.is',
address: 'development@island.is',
},
baseApiUrl: 'http://localhost:4444',
attachmentBucket: 'attachmentBucket',
}
}
const mockConfig = {
jwtSecret: 'supersecret',
clientLocationOrigin: 'http://localhost:4200',
email: {
sender: 'Devland.is',
address: 'development@island.is',
},
baseApiUrl: 'http://localhost:4444',
attachmentBucket: 'attachmentBucket',
}

let server: request.SuperTest<request.Test>
Expand All @@ -91,7 +87,7 @@ beforeAll(async () => {
.overrideProvider(EmailService)
.useClass(MockEmailService)
.overrideProvider(sharedModuleConfig.KEY)
.useClass(MockSharedConfig)
.useValue(mockConfig)
.overrideGuard(IdsUserGuard)
.useValue(mockAuthGuard),
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ describe('AccidentNotificationService', () => {
},
{
provide: sharedModuleConfig.KEY,
useValue: {
clientLocationOrigin: 'http://localhost:4200',
},
useValue: {},
},
{
provide: ACCIDENT_NOTIFICATION_CONFIG,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,7 @@ describe('ParentalLeaveService', () => {
},
{
provide: sharedModuleConfig.KEY,
useValue: {
clientLocationOrigin: 'http://localhost:4200',
},
useValue: {},
},
SharedTemplateApiService,
{
Expand Down

0 comments on commit a3cb4f6

Please sign in to comment.