Skip to content

Commit

Permalink
Oppdatere syntheticUserFnr til named export, ignore useEffects exhaus…
Browse files Browse the repository at this point in the history
…tive-deps
  • Loading branch information
nattaphongklinjan committed Nov 15, 2023
1 parent 827cffc commit 61cf3c0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/__mocks__/handlers/frontend/dokumenter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { faker } from "@faker-js/faker";
import { Journalpost } from "../../../pages/api/dokumenter";
import syntheticUserFnr from "./syntheticUserFnr";
import { syntheticUserFnr } from "./syntheticUserFnr";
import { AvsenderMottakerIdType, Journalposttype } from "../../../saf";

export const dokumentListeResolver = (req, res, ctx) => {
Expand Down
4 changes: 2 additions & 2 deletions src/__mocks__/handlers/frontend/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { rest } from "msw";
import syntheticUserFnr from "./syntheticUserFnr";
import { syntheticUserFnr } from "./syntheticUserFnr";
import { dokumentListeResolver } from "./dokumenter";
import kontoResolver from "./konto";
import soknaderResolver from "./soknader";
Expand All @@ -14,7 +14,7 @@ export const frontendHandlers = [
ctx.json({
user: { fnr: syntheticUserFnr, locale: "no" },
expires_in: 50,
})
}),
);
}),
rest.get(api("/dokumenter"), dokumentListeResolver),
Expand Down
2 changes: 1 addition & 1 deletion src/__mocks__/handlers/frontend/syntheticUserFnr.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default "1234";
export const syntheticUserFnr = "1234";
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ export function DocumentActionButtons(props: IProps) {
logPreviewOpened();
} else if (opened.current) {
const previewTimestamp = Math.round(
(+new Date() - opened.current) / 1000
(+new Date() - opened.current) / 1000,
);
opened.current = null;
logDocumentPreviewClosed(previewTimestamp);
}
// eslint-disable-next-line
}, [modalIsOpen, logPreviewOpened, logDocumentDownloaded]);

function handleDownload() {
Expand Down

0 comments on commit 61cf3c0

Please sign in to comment.