Set up comprehensive frontend testing infrastructure
- Install Jest for unit testing with React Testing Library - Install Playwright for end-to-end testing - Configure Jest with proper TypeScript support and module mapping - Create test setup files and utilities for both unit and e2e tests Components: * Jest configuration with coverage thresholds * Playwright configuration with browser automation * Unit tests for LoginForm, AuthContext, and useSocketIO hook * E2E tests for authentication, dashboard, and agents workflows * GitHub Actions workflow for automated testing * Mock data and API utilities for consistent testing * Test documentation with best practices Testing features: - Unit tests with 70% coverage threshold - E2E tests with API mocking and user journey testing - CI/CD integration for automated test runs - Cross-browser testing support with Playwright - Authentication system testing end-to-end 🚀 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
50
frontend/node_modules/@testing-library/user-event/dist/esm/event/dispatchEvent.js
generated
vendored
Normal file
50
frontend/node_modules/@testing-library/user-event/dist/esm/event/dispatchEvent.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
import './behavior/click.js';
|
||||
import './behavior/cut.js';
|
||||
import './behavior/keydown.js';
|
||||
import './behavior/keypress.js';
|
||||
import './behavior/keyup.js';
|
||||
import './behavior/paste.js';
|
||||
import { behavior } from './behavior/registry.js';
|
||||
import { wrapEvent } from './wrapEvent.js';
|
||||
import { isMouseEvent, isKeyboardEvent } from './eventMap.js';
|
||||
import { createEvent } from './createEvent.js';
|
||||
|
||||
function dispatchUIEvent(target, type, init, preventDefault = false) {
|
||||
if (isMouseEvent(type) || isKeyboardEvent(type)) {
|
||||
init = {
|
||||
...init,
|
||||
...this.system.getUIEventModifiers()
|
||||
};
|
||||
}
|
||||
const event = createEvent(type, target, init);
|
||||
return dispatchEvent.call(this, target, event, preventDefault);
|
||||
}
|
||||
function dispatchEvent(target, event, preventDefault = false) {
|
||||
var _behavior_type;
|
||||
const type = event.type;
|
||||
const behaviorImplementation = preventDefault ? ()=>{} : (_behavior_type = behavior[type]) === null || _behavior_type === undefined ? undefined : _behavior_type.call(behavior, event, target, this);
|
||||
if (behaviorImplementation) {
|
||||
event.preventDefault();
|
||||
let defaultPrevented = false;
|
||||
Object.defineProperty(event, 'defaultPrevented', {
|
||||
get: ()=>defaultPrevented
|
||||
});
|
||||
Object.defineProperty(event, 'preventDefault', {
|
||||
value: ()=>{
|
||||
defaultPrevented = event.cancelable;
|
||||
}
|
||||
});
|
||||
wrapEvent(()=>target.dispatchEvent(event));
|
||||
if (!defaultPrevented) {
|
||||
behaviorImplementation();
|
||||
}
|
||||
return !defaultPrevented;
|
||||
}
|
||||
return wrapEvent(()=>target.dispatchEvent(event));
|
||||
}
|
||||
function dispatchDOMEvent(target, type, init) {
|
||||
const event = createEvent(type, target, init);
|
||||
wrapEvent(()=>target.dispatchEvent(event));
|
||||
}
|
||||
|
||||
export { dispatchDOMEvent, dispatchEvent, dispatchUIEvent };
|
||||
Reference in New Issue
Block a user