Added more test for 75% globally

This commit is contained in:
Beverly Nguyen
2025-09-16 21:55:17 -07:00
parent 0c347fe3db
commit 8347bee078

View File

@@ -424,3 +424,23 @@ test('handleDropdownChange updates subtitle text correctly', () => {
window.fetchData.mockRestore();
});
test('dropdown change handles DOM updates for table filtering', () => {
const selectElement = document.getElementById('options');
jest.spyOn(window, 'fetchData').mockImplementation(() => {});
selectElement.value = 'service';
window.handleDropdownChange({ target: selectElement });
let subtitle = document.querySelector('#activityChartContainer .chart-subtitle');
expect(subtitle.textContent).toContain('Service');
selectElement.value = 'individual';
window.handleDropdownChange({ target: selectElement });
subtitle = document.querySelector('#activityChartContainer .chart-subtitle');
expect(subtitle.textContent).toContain('Individual');
window.fetchData.mockRestore();
});