diff --git a/.github/workflows/pull_request_test.yml b/.github/workflows/pull_request_test.yml index 6cb5c6778e..9f6010e85f 100644 --- a/.github/workflows/pull_request_test.yml +++ b/.github/workflows/pull_request_test.yml @@ -53,6 +53,6 @@ jobs: - name: Install Dependencies run: yarn install --frozen-lockfile - name: Run Unit Tests for Changed Files Only - run: yarn run test:changed + run: NODE_OPTIONS="--max-old-space-size=4096" yarn run test:changed - name: Run Lint run: yarn run lint \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce356edad2..2b0ab2cd51 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: run: yarn install - name: Run tests - run: yarn test + run: NODE_OPTIONS="--max-old-space-size=4096" yarn test - name: Upload test results if: failure() diff --git a/package.json b/package.json index 6bf027efb5..a29e467274 100644 --- a/package.json +++ b/package.json @@ -177,7 +177,8 @@ "@typescript-eslint/eslint-plugin": "^8.44.1", "@typescript-eslint/parser": "^8.44.1", "@vitejs/plugin-react": "^4.5.0", - "@vitest/ui": "3.2.2", + "@vitest/coverage-v8": "^3.2.4", + "@vitest/ui": "^3.2.4", "babel-jest": "^29.7.0", "baseline-browser-mapping": "^2.9.17", "cross-env": "^5.2.1", @@ -206,7 +207,7 @@ "stylelint-config-standard": "^39.0.1", "typescript": "^4.8.4", "vite": "^6.3.5", - "vitest": "^3.2.0" + "vitest": "^3.2.4" }, "lint-staged": { "*.{js,jsx,ts,tsx}": [ diff --git a/src/components/Reports/PeopleReport/PeopleReport.jsx b/src/components/Reports/PeopleReport/PeopleReport.jsx index 8ff906bf3b..6b5d81e0a0 100644 --- a/src/components/Reports/PeopleReport/PeopleReport.jsx +++ b/src/components/Reports/PeopleReport/PeopleReport.jsx @@ -482,7 +482,6 @@ class PeopleReport extends Component { const boxCount = visibleBlocks.length; return ( -
@@ -492,7 +491,6 @@ class PeopleReport extends Component { boxCount === 3 ? styles.threeBoxes : ''}`} > - -
-

- - {firstName} {lastName} - -

-
-
-

Role

-

{role}

-
-
-
-
-

Title

-

{jobTitle}

-
-
- - {/* {endDate ? ( */} -
- this.setRehireable(!isRehireable)} - label="Rehireable" - darkMode={darkMode} - className={`${styles.reportStats} ${darkMode ? `${styles.bgYinmnBlue} ${styles.textLight}` : ''}`} - backgroundColorCN={darkMode ? styles.bgYinmnBlue : ""} - textColorCN={darkMode ? styles.textLight : ""} - /> -
-
-
-

Start Date

-

{formatDate(startDate)}

-
-
-

End Date

-

{endDate ? formatDate(endDate) : 'N/A'}

-
-
-
+
+ {/* Name */} + + {firstName} {lastName} + + + {/* Info Grid */} +
+
+

Role

+
{role}
+
+ +
+

Title

+
{jobTitle}
+
+ +
+

Start Date

+
{formatDate(startDate)}
+
+ +
+

End Date

+
+ {endDate ? formatDate(endDate) : 'N/A'} +
+
+
+ + {/* Checkbox */} +
+ this.setRehireable(!isRehireable)} + label="Rehireable" + darkMode={darkMode} + backgroundColorCN={darkMode ? styles.bgYinmnBlue : ""} + textColorCN={darkMode ? styles.textLight : ""} + /> +
+
+
diff --git a/src/components/Reports/PeopleReport/PeopleReport.module.css b/src/components/Reports/PeopleReport/PeopleReport.module.css index 4efcd61d65..358e1372a3 100644 --- a/src/components/Reports/PeopleReport/PeopleReport.module.css +++ b/src/components/Reports/PeopleReport/PeopleReport.module.css @@ -1,5 +1,6 @@ body { margin: 0; + /* font-family: 'Lato', sans-serif; */ } @@ -38,7 +39,7 @@ body { } */ -/*profile style changes ends*/ +/* profile style changes ends */ .btn--dark-sea-green { background-color: #c9d6c6 !important; @@ -160,7 +161,7 @@ body { background-color: #666; } -/*Badge changes ends here*/ +/* Badge changes ends here */ .visualizationDiv { /* margin-bottom: 10px; */ @@ -185,10 +186,10 @@ body { background-color: #f2f2f2; } -/*Table css starts*/ +/* Table css starts */ .introDate { - margin: 16px 0px 16px 0px; + margin: 16px 0; display: flex; } @@ -196,9 +197,9 @@ body { width: 100%; } -@media (max-width: 850px) { +@media (width <= 850px) { .introDate { - margin: 16px 0px 16px 0px; + margin: 16px 0; display: flex; justify-content: center; } @@ -236,13 +237,13 @@ body { color:white } -@media (max-width: 1488px) { +@media (width <= 1488px) { .peopleReportTimeLogsWrapper > .peopleReportTimeLogBlock { flex: 0 1 calc((100% - 1rem) / 2); } } -@media (max-width: 1155px) { +@media (width <= 1155px) { .peopleReportTimeLogsWrapper { justify-content: center; gap: 1.5rem; @@ -254,26 +255,31 @@ body { } .peopleReportTimeLogsWrapper.threeBoxes > .peopleReportTimeLogBlock { - flex: 0 1 calc((100% - 2rem) / 3); /* 3 per row */ + flex: 0 1 28%; /* Smaller boxes that fit in one line */ + min-width: 120px; /* Minimum width to keep readable */ } /* Prevent wrapping weirdly at mid-screen sizes for 3-box layout */ -@media (max-width: 1488px) { +@media (width <= 1488px) { .peopleReportTimeLogsWrapper.threeBoxes > .peopleReportTimeLogBlock { - flex: 0 1 calc((100% - 2rem) / 3); + flex: 0 1 28%; + min-width: 120px; } } -@media (max-width: 1155px) { - .peopleReportTimeLogsWrapper.threeBoxes { - justify-content: center; - gap: 1.5rem; - } +@media (width <= 1155px) { .peopleReportTimeLogsWrapper.threeBoxes > .peopleReportTimeLogBlock { - flex: 0 1 100%; /* Stack only on smaller screens */ + flex: 0 1 28%; + min-width: 120px; } } +@media (width <= 850px) { + .peopleReportTimeLogsWrapper.threeBoxes > .peopleReportTimeLogBlock { + flex: 0 1 28%; + min-width: 120px; + } +} .infringementContainer { display: flex; @@ -349,7 +355,7 @@ body { color: #e9ecef; } -@media (max-width: 1100px) { +@media (width <= 1100px) { .mobilePeopleTable { display: flex; flex-direction: column; @@ -362,7 +368,7 @@ body { order: 1; } -@media (max-width: 981px) { +@media (width <= 981px) { .orderColumn { order: -1; flex: 0 0 100%; @@ -400,10 +406,9 @@ body { width: 23vw; display: flex; flex-direction: column; - min-height: 100%; margin-top: 2rem; - height: 140vh; - overflow: hidden; + height: auto; + overflow: visible; } .peopleReportProfileWrapper { @@ -420,30 +425,30 @@ body { background-color: white; padding: 2rem; border-radius: 16px; - box-shadow: 0 0 12px rgba(0, 0, 0, 0.08); + box-shadow: 0 0 12px rgb(0 0 0 / 8%); height: 698px; margin-top: 2rem; } -@media (min-width: 1489px) and (max-width: 1784px) { +@media (width >= 1489px) and (width <= 1784px) { .reportStats { height: 721px; } } -@media (min-width: 1156px) and (max-width: 1488px) { +@media (width >= 1156px) and (width <= 1488px) { .reportStats { height: 869px; } } -@media (min-width: 1025px) and (max-width: 1155px) { +@media (width >= 1025px) and (width <= 1155px) { .reportStats { height: 873px; } } -@media (min-width: 960px) and (max-width: 1024px) { +@media (width >= 960px) and (width <= 1024px) { .reportStats { height: 895px; } @@ -458,17 +463,16 @@ body { } .textLight { - color: #ffffff !important; + color: #fff !important; } .fontWeightBold { font-weight: 600 !important; /* or 700 if you prefer */ } -@media (max-width: 960px) { +@media (width <= 640px) { .peopleReportFlexLayout { - flex-direction: column; - flex-wrap: wrap; + flex-flow: column wrap; } .peopleReportLeft, @@ -477,10 +481,15 @@ body { } .peopleReportRight { - margin-top: 1rem; + order: -1; + margin-top: 0; height: auto !important; /* override the 140vh */ } + .peopleReportLeft { + order: 0; + } + .peopleReportTimeLogsWrapper { flex-direction: column; align-items: center; @@ -517,4 +526,56 @@ body { justify-content: center; align-items: center; } + + .card { + border-radius: 16px; + padding: 20px; + transition: all 0.3s ease; +} + +.lightCard { + background: #fff; + box-shadow: 0 4px 12px rgb(0 0 0 / 8%); +} + +.darkCard { + background: #1e3a5f; + color: #f5f5f5; +} + +.userName { + font-size: 22px; + font-weight: 600; + display: block; + margin-bottom: 15px; + text-decoration: none; +} + +.userName:hover { + text-decoration: underline; +} + +.infoGrid { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 15px; + margin-bottom: 15px; +} + +.label { + font-size: 12px; + color: #888; + margin-bottom: 4px; +} + +.value { + font-size: 16px; + font-weight: 500; +} + +.checkboxWrapper { + margin-top: 10px; +} + + } diff --git a/src/components/common/PieChart/ProjectPieChart.jsx b/src/components/common/PieChart/ProjectPieChart.jsx index 4a3393f36a..3ae77cde90 100644 --- a/src/components/common/PieChart/ProjectPieChart.jsx +++ b/src/components/common/PieChart/ProjectPieChart.jsx @@ -147,10 +147,7 @@ export default function UserProjectD3PieChart({ projectsData, darkMode }) { -
+
({ })), })); +// Mock AutoUpdate component to prevent intervals in tests +vi.mock('../components/AutoUpdate', () => ({ + default: () => null, +})); + // Mock jspdf vi.mock('jspdf', () => ({ jsPDF: vi.fn().mockImplementation(() => ({ diff --git a/vitest.config.js b/vitest.config.js index b2f8cb62de..7500eb9e0c 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -100,5 +100,15 @@ export default defineConfig({ environment: 'jsdom', globals: true, setupFiles: ['./src/setupTests.js'], + testTimeout: 30000, // 30 seconds timeout + pool: 'threads', + poolOptions: { + threads: { + singleThread: false, + useAtomics: true, + }, + }, + maxThreads: 4, + minThreads: 1, }, });