 aacb45156b
			
		
	
	aacb45156b
	
	
	
		
			
			- 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>
		
			
				
	
	
		
			40 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| "use strict";
 | |
| 
 | |
| Object.defineProperty(exports, "__esModule", {
 | |
|   value: true
 | |
| });
 | |
| exports.queryByDisplayValue = exports.queryAllByDisplayValue = exports.getByDisplayValue = exports.getAllByDisplayValue = exports.findByDisplayValue = exports.findAllByDisplayValue = void 0;
 | |
| var _queryHelpers = require("../query-helpers");
 | |
| var _helpers = require("../helpers");
 | |
| var _allUtils = require("./all-utils");
 | |
| const queryAllByDisplayValue = (container, value, {
 | |
|   exact = true,
 | |
|   collapseWhitespace,
 | |
|   trim,
 | |
|   normalizer
 | |
| } = {}) => {
 | |
|   (0, _helpers.checkContainerType)(container);
 | |
|   const matcher = exact ? _allUtils.matches : _allUtils.fuzzyMatches;
 | |
|   const matchNormalizer = (0, _allUtils.makeNormalizer)({
 | |
|     collapseWhitespace,
 | |
|     trim,
 | |
|     normalizer
 | |
|   });
 | |
|   return Array.from(container.querySelectorAll(`input,textarea,select`)).filter(node => {
 | |
|     if (node.tagName === 'SELECT') {
 | |
|       const selectedOptions = Array.from(node.options).filter(option => option.selected);
 | |
|       return selectedOptions.some(optionNode => matcher((0, _allUtils.getNodeText)(optionNode), optionNode, value, matchNormalizer));
 | |
|     } else {
 | |
|       return matcher(node.value, node, value, matchNormalizer);
 | |
|     }
 | |
|   });
 | |
| };
 | |
| const getMultipleError = (c, value) => `Found multiple elements with the display value: ${value}.`;
 | |
| const getMissingError = (c, value) => `Unable to find an element with the display value: ${value}.`;
 | |
| const queryAllByDisplayValueWithSuggestions = exports.queryAllByDisplayValue = (0, _queryHelpers.wrapAllByQueryWithSuggestion)(queryAllByDisplayValue, queryAllByDisplayValue.name, 'queryAll');
 | |
| const [queryByDisplayValue, getAllByDisplayValue, getByDisplayValue, findAllByDisplayValue, findByDisplayValue] = (0, _allUtils.buildQueries)(queryAllByDisplayValue, getMultipleError, getMissingError);
 | |
| exports.findByDisplayValue = findByDisplayValue;
 | |
| exports.findAllByDisplayValue = findAllByDisplayValue;
 | |
| exports.getByDisplayValue = getByDisplayValue;
 | |
| exports.getAllByDisplayValue = getAllByDisplayValue;
 | |
| exports.queryByDisplayValue = queryByDisplayValue; |