Skip to content

Commit

Permalink
Lag mock av usynlig kandidat
Browse files Browse the repository at this point in the history
  • Loading branch information
frodank committed Aug 2, 2023
1 parent c010c42 commit 630019a
Showing 1 changed file with 67 additions and 48 deletions.
115 changes: 67 additions & 48 deletions mock/kandidatsok-proxy/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,73 @@ import { api } from '../../src/felles/api';
import { Innsatsgruppe } from 'felles/domene/kandidat-i-søk/Oppfølgingsinformasjon';

export const kandidatsøkMock = [
rest.post(api.kandidatsøk, (_, res, ctx) => {
const respons: Respons = {
_shards: {
total: 0,
failed: 0,
skipped: 0,
successful: 0,
},
took: 23,
timed_out: false,
hits: {
total: {
value: 1,
relation: 'eq',
},
max_score: 1,
hits: [
{
_id: '',
_index: '',
_score: 1,
_type: '',
_source: {
aktorId: '123',
arenaKandidatnr: 'AB123456',
fornavn: 'Joar',
etternavn: 'Giil',
fodselsnummer: '01010101006',
geografiJobbonsker: [
{
geografiKodeTekst: 'Geiranger',
geografiKode: '1000',
},
],
kvalifiseringsgruppekode: Innsatsgruppe.SituasjonsbestemtInnsats,
yrkeJobbonskerObj: [
{
primaertJobbonske: true,
sokeTitler: [],
styrkBeskrivelse: 'Gartner',
styrkKode: '01',
},
],
},
},
],
},
};
rest.post(api.kandidatsøk, async (req, res, ctx) => {
const respons: Respons = (await req.text()).includes('12345678910')
? {
took: 1,
timed_out: false,
_shards: {
total: 3,
successful: 3,
skipped: 0,
failed: 0,
},
hits: {
total: {
value: 0,
relation: 'eq',
},
max_score: null,
hits: [],
},
}
: {
_shards: {
total: 0,
failed: 0,
skipped: 0,
successful: 0,
},
took: 23,
timed_out: false,
hits: {
total: {
value: 1,
relation: 'eq',
},
max_score: 1,
hits: [
{
_id: '',
_index: '',
_score: 1,
_type: '',
_source: {
aktorId: '123',
arenaKandidatnr: 'AB123456',
fornavn: 'Joar',
etternavn: 'Giil',
fodselsnummer: '01010101006',
geografiJobbonsker: [
{
geografiKodeTekst: 'Geiranger',
geografiKode: '1000',
},
],
kvalifiseringsgruppekode: Innsatsgruppe.SituasjonsbestemtInnsats,
yrkeJobbonskerObj: [
{
primaertJobbonske: true,
sokeTitler: [],
styrkBeskrivelse: 'Gartner',
styrkKode: '01',
},
],
},
},
],
},
};

return res(ctx.json(respons));
}),
Expand Down

0 comments on commit 630019a

Please sign in to comment.