Skip to content

Commit

Permalink
fix feilende tester
Browse files Browse the repository at this point in the history
  • Loading branch information
johatr committed Sep 15, 2023
1 parent 34acd80 commit 9a34d9d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 10 additions & 7 deletions src/moduler/aktivitet/aktivitet-forms/mote/MoteAktivitetForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ const schema = z.object({
export type MoteAktivitetFormValues = z.infer<typeof schema>;

interface Props {
onSubmit: (data: MoteAktivitetFormValues & { status: string; avtalt: boolean }) => Promise<void>;
onSubmit: (
data: Omit<MoteAktivitetFormValues, 'klokkeslett'> & { status: string; avtalt: boolean },
) => Promise<void>;
dirtyRef: MutableRefObject<boolean>;
aktivitet?: MoteAktivitet;
}
Expand Down Expand Up @@ -114,15 +116,16 @@ const MoteAktivitetForm = (props: Props) => {
<form
autoComplete="off"
noValidate
onSubmit={handleSubmit((data) =>
onSubmit({
...data,
onSubmit={handleSubmit((data) => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { klokkeslett, ...rest } = data;
return onSubmit({
...rest,
...beregnFraTil(data),
status: AktivitetStatus.PLANLAGT,
avtalt: false,
// dato: selectedDay!!.toString(),
}),
)}
});
})}
>
<FormProvider {...formHandlers}>
<div className="space-y-8">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ describe('MoteAktivitetForm', () => {
forberedelser: '',
// fraDato: '2023-09-21T06:00:00.000Z',
kanal: 'TELEFON',
klokkeslett: '08:00',
status: 'PLANLAGT',
// tilDato: '2023-09-21T06:30:00.000Z',
tittel: 'Møte med NAV',
Expand Down Expand Up @@ -191,7 +190,6 @@ describe('MoteAktivitetForm', () => {
forberedelser: '',
// fraDato: '2023-09-21T06:00:00.000Z',
kanal: 'TELEFON',
klokkeslett: '08:00',
status: 'PLANLAGT',
// tilDato: '2023-09-21T08:30:00.000Z',
tittel: 'Møte med NAV',
Expand Down

0 comments on commit 9a34d9d

Please sign in to comment.