Skip to content

Commit

Permalink
Merge pull request #11316 from qmonmert/fixnested4
Browse files Browse the repository at this point in the history
Sonar: Fix - refactor this code to not nest functions more than 4 levels deep
  • Loading branch information
murdos authored Nov 7, 2024
2 parents 918074c + a0da117 commit f47a7c5
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 f47a7c5

Please sign in to comment.