Skip to content

Commit

Permalink
Merge pull request #2479 from objectcomputing/bugfix-fix-pulse-report…
Browse files Browse the repository at this point in the history
…-page-snapshots

Fix PulseReportPage test
  • Loading branch information
mkimberlin authored Jun 5, 2024
2 parents 611ba8e + 870bacf commit a7cc916
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions web-ui/src/pages/PulseReportPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ const PulseReportPage = () => {
const csrf = selectCsrfToken(state);
const memberMap = selectProfileMap(state);

const initialDateFrom = new Date();
// Mock the date if under test so the snapshot stays consistent
const today = process?.env?.VITEST_WORKER_ID ? new Date(2024, 5, 4) : new Date();
const initialDateFrom = new Date(today);
initialDateFrom.setMonth(initialDateFrom.getMonth() - 3);
const [dateFrom, setDateFrom] = useState(initialDateFrom);
const [dateTo, setDateTo] = useState(new Date());
const [dateTo, setDateTo] = useState(today);

const [averageData, setAverageData] = useState({});
const [barChartData, setBarChartData] = useState([]);
Expand Down

0 comments on commit a7cc916

Please sign in to comment.