Skip to content

Commit

Permalink
Merge branch 'main' into j-s/civil-claimant-assigned-notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Nov 15, 2024
2 parents 25ac665 + fda8787 commit 8c33eb9
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,11 @@ export class SubpoenaService {
defenderNationalId,
)

if (update.serviceStatus && subpoena.case) {
if (
update.serviceStatus &&
update.serviceStatus !== subpoena.serviceStatus &&
subpoena.case
) {
this.eventService.postEvent(
'SUBPOENA_SERVICE_STATUS',
subpoena.case,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import {
DelegationScope,
DelegationsIndexService,
} from '@island.is/auth-api-lib'
import { RskRelationshipsClient } from '@island.is/clients-rsk-relationships'
import { NationalRegistryClientService } from '@island.is/clients/national-registry-v2'
import { CompanyRegistryClientService } from '@island.is/clients/rsk/company-registry'
import {
expectMatchingDelegations,
FixtureFactory,
Expand Down Expand Up @@ -41,9 +43,16 @@ describe('MeDelegationsController', () => {
})
server = request(app.getHttpServer())
delegationIndexService = app.get(DelegationsIndexService)
const rskRelationshipsClientService = app.get(RskRelationshipsClient)
const nationalRegistryClientService = app.get(
NationalRegistryClientService,
)
const companyRegistryClientService = app.get(
CompanyRegistryClientService,
)
jest
.spyOn(nationalRegistryClientService, 'getCustodyChildren')
.mockImplementation(async () => [])
jest
.spyOn(nationalRegistryClientService, 'getIndividual')
.mockImplementation(async (nationalId: string) =>
Expand All @@ -52,6 +61,12 @@ describe('MeDelegationsController', () => {
name: fromName,
}),
)
jest
.spyOn(rskRelationshipsClientService, 'getIndividualRelationships')
.mockImplementation(async () => null)
jest
.spyOn(companyRegistryClientService, 'getCompany')
.mockImplementation(async () => null)
jest
.spyOn(delegationIndexService, 'indexDelegations')
.mockImplementation()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { CompanyRegistryClientService } from '@island.is/clients/rsk/company-registry'

export const CompanyRegistryClientServiceMock: Partial<CompanyRegistryClientService> =
{
getCompany() {
return Promise.resolve(null)
},
}
1 change: 1 addition & 0 deletions apps/services/auth/public-api/test/mocks/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './einstaklingurApi.mock'
export * from './rskProcuringClient.mock'
export * from './featureFlagService.mock'
export * from './companyRegistryClientService.mock'
4 changes: 4 additions & 0 deletions apps/services/auth/public-api/test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
IndividualDto,
NationalRegistryClientService,
} from '@island.is/clients/national-registry-v2'
import { CompanyRegistryClientService } from '@island.is/clients/rsk/company-registry'
import { ConfigType } from '@island.is/nest/config'
import { FeatureFlagService } from '@island.is/nest/feature-flags'
import {
Expand All @@ -35,6 +36,7 @@ import {

import { AppModule } from '../src/app/app.module'
import {
CompanyRegistryClientServiceMock,
createMockEinstaklingurApi,
FeatureFlagServiceMock,
RskProcuringClientMock,
Expand Down Expand Up @@ -156,6 +158,8 @@ export const setupWithAuth = async ({
.useValue(createMockEinstaklingurApi(nationalRegistryUser))
.overrideProvider(RskRelationshipsClient)
.useValue(RskProcuringClientMock)
.overrideProvider(CompanyRegistryClientService)
.useValue(CompanyRegistryClientServiceMock)
.overrideProvider(DelegationConfig.KEY)
.useValue(delegationConfig)
.overrideProvider(FeatureFlagService)
Expand Down

0 comments on commit 8c33eb9

Please sign in to comment.