Skip to content

test(COMPT-31): reduce duplicated test blocks for Sonar quality gate

6c9e956
Select commit
Loading
Failed to load commit list.
Closed

feat(COMPT-31): add useMediaQuery, useWindowSize, useClickOutside, us… #7

test(COMPT-31): reduce duplicated test blocks for Sonar quality gate
6c9e956
Select commit
Loading
Failed to load commit list.
SonarQubeCloud / SonarCloud Code Analysis succeeded Mar 30, 2026 in 23s

Annotations

Check warning on line 11 in src/hooks/useMediaQuery.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V1yBiTWT8gsVpEm&open=AZ0-6V1yBiTWT8gsVpEm&pullRequest=8

Check warning on line 78 in src/hooks/useMediaQuery.test.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V2fBiTWT8gsVpEq&open=AZ0-6V2fBiTWT8gsVpEq&pullRequest=8

Check warning on line 23 in src/hooks/useWindowSize.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V0rBiTWT8gsVpEc&open=AZ0-6V0rBiTWT8gsVpEc&pullRequest=8

Check warning on line 101 in src/hooks/useIntersectionObserver.test.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis.window` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V3IBiTWT8gsVpE2&open=AZ0-6V3IBiTWT8gsVpE2&pullRequest=8

Check warning on line 81 in src/hooks/useWindowSize.test.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V2wBiTWT8gsVpEw&open=AZ0-6V2wBiTWT8gsVpEw&pullRequest=8

Check warning on line 67 in src/hooks/useWindowSize.test.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V2wBiTWT8gsVpEv&open=AZ0-6V2wBiTWT8gsVpEv&pullRequest=8

Check warning on line 49 in src/hooks/useClickOutside.test.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V1gBiTWT8gsVpEg&open=AZ0-6V1gBiTWT8gsVpEg&pullRequest=8

Check warning on line 64 in src/hooks/useIntersectionObserver.test.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V3IBiTWT8gsVpEy&open=AZ0-6V3IBiTWT8gsVpEy&pullRequest=8

Check warning on line 14 in src/hooks/useClickOutside.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis.window` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V2NBiTWT8gsVpEo&open=AZ0-6V2NBiTWT8gsVpEo&pullRequest=8

Check warning on line 11 in src/hooks/useMediaQuery.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Unexpected negated condition.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V1yBiTWT8gsVpEk&open=AZ0-6V1yBiTWT8gsVpEk&pullRequest=8

Check warning on line 11 in src/hooks/useMediaQuery.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis.window` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V1yBiTWT8gsVpEl&open=AZ0-6V1yBiTWT8gsVpEl&pullRequest=8

Check warning on line 19 in src/hooks/useWindowSize.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V0rBiTWT8gsVpEa&open=AZ0-6V0rBiTWT8gsVpEa&pullRequest=8

Check warning on line 31 in src/hooks/useWindowSize.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V0rBiTWT8gsVpEd&open=AZ0-6V0rBiTWT8gsVpEd&pullRequest=8

Check failure on line 100 in src/hooks/useIntersectionObserver.test.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Refactor this function to not always return the same value.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V3IBiTWT8gsVpE1&open=AZ0-6V3IBiTWT8gsVpE1&pullRequest=8

Check warning on line 77 in src/hooks/useMediaQuery.test.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis.window` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V2fBiTWT8gsVpEp&open=AZ0-6V2fBiTWT8gsVpEp&pullRequest=8

Check warning on line 7 in src/hooks/useMediaQuery.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V1yBiTWT8gsVpEj&open=AZ0-6V1yBiTWT8gsVpEj&pullRequest=8

Check warning on line 6 in src/hooks/useWindowSize.test.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V2vBiTWT8gsVpEr&open=AZ0-6V2vBiTWT8gsVpEr&pullRequest=8

Check warning on line 17 in src/hooks/useWindowSize.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis.window` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V0rBiTWT8gsVpEZ&open=AZ0-6V0rBiTWT8gsVpEZ&pullRequest=8

Check warning on line 22 in src/hooks/useWindowSize.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V0rBiTWT8gsVpEb&open=AZ0-6V0rBiTWT8gsVpEb&pullRequest=8

Check warning on line 43 in src/hooks/useWindowSize.test.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V2wBiTWT8gsVpEt&open=AZ0-6V2wBiTWT8gsVpEt&pullRequest=8

Check warning on line 78 in src/hooks/useIntersectionObserver.test.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V3IBiTWT8gsVpEz&open=AZ0-6V3IBiTWT8gsVpEz&pullRequest=8

Check warning on line 11 in src/hooks/useIntersectionObserver.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis.window` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V2BBiTWT8gsVpEn&open=AZ0-6V2BBiTWT8gsVpEn&pullRequest=8

Check warning on line 67 in src/hooks/useClickOutside.test.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V1gBiTWT8gsVpEh&open=AZ0-6V1gBiTWT8gsVpEh&pullRequest=8

Check warning on line 64 in src/hooks/useWindowSize.test.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `globalThis` over `window`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V2wBiTWT8gsVpEu&open=AZ0-6V2wBiTWT8gsVpEu&pullRequest=8

Check warning on line 94 in src/hooks/useIntersectionObserver.test.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.

See more on https://sonarcloud.io/project/issues?id=CISCODE-MA_HooksKit&issues=AZ0-6V3IBiTWT8gsVpE0&open=AZ0-6V3IBiTWT8gsVpE0&pullRequest=8