imageFilenames and imageFilename, backend integration tests, frontend tests, removed username references

This commit is contained in:
jackiettran
2025-11-26 23:13:23 -05:00
parent f2d3aac029
commit 11593606aa
52 changed files with 2815 additions and 150 deletions

View File

@@ -3,3 +3,53 @@
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';
// Mock window.location for tests that use navigation
const mockLocation = {
...window.location,
href: 'http://localhost:3000',
pathname: '/',
assign: jest.fn(),
replace: jest.fn(),
reload: jest.fn(),
};
Object.defineProperty(window, 'location', {
value: mockLocation,
writable: true,
});
// Suppress console errors during tests (optional, comment out for debugging)
const originalConsoleError = console.error;
const originalConsoleWarn = console.warn;
beforeAll(() => {
console.error = (...args: any[]) => {
// Filter out known React warnings during tests
if (
typeof args[0] === 'string' &&
(args[0].includes('Warning: ReactDOM.render is no longer supported') ||
args[0].includes('Warning: An update to') ||
args[0].includes('act(...)'))
) {
return;
}
originalConsoleError.call(console, ...args);
};
console.warn = (...args: any[]) => {
// Filter out known warnings
if (
typeof args[0] === 'string' &&
args[0].includes('componentWillReceiveProps')
) {
return;
}
originalConsoleWarn.call(console, ...args);
};
});
afterAll(() => {
console.error = originalConsoleError;
console.warn = originalConsoleWarn;
});