Skip to content

Commit

Permalink
Sonar: Fix - refactor this code to not nest functions more than 4 lev…
Browse files Browse the repository at this point in the history
…els deep
  • Loading branch information
qmonmert committed Nov 7, 2024
1 parent 918074c commit a0da117
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1353,9 +1353,10 @@ describe('Landscape', () => {
}

const setupScrollTest = (wrapper: VueWrapper, { moduleRect }: { moduleRect: ModuleRect }) => {
const mockToJSON = vi.fn().mockImplementation(() => JSON.stringify(moduleRect));
const mockModuleRect = vi.spyOn(Element.prototype, 'getBoundingClientRect').mockImplementation(() => ({
...moduleRect,
toJSON: () => JSON.stringify(moduleRect),
toJSON: mockToJSON,
}));

const mockContainerRect = vi.fn().mockReturnValue({
Expand Down

0 comments on commit a0da117

Please sign in to comment.