- Add .gitignore to exclude node_modules, dist, logs, and system files - Add comprehensive project documentation including README, deployment guide, and development setup - Add .kiro project specifications for amazon-product-bar-extension, appwrite-cloud-storage, appwrite-userid-repair, blacklist-feature, and enhanced-item-management - Add .kiro steering documents for product, structure, styling, and tech guidelines - Add VSCode settings configuration for consistent development environment - Add manifest.json and babel/vite configuration for extension build setup - Add complete source code implementation including AppWrite integration, storage managers, UI components, and services - Add comprehensive test suite with Jest configuration and 30+ test files covering all major modules - Add test HTML files for integration testing and validation - Add coverage reports and build validation scripts - Add AppWrite setup and repair documentation for database schema management - Add migration guides and responsive accessibility implementation documentation - Establish foundation for Amazon product bar extension with full feature set including blacklist management, enhanced item workflows, and real-time synchronization
36 lines
767 B
JavaScript
36 lines
767 B
JavaScript
// Jest setup file for DOM environment
|
|
import { jest, beforeEach } from '@jest/globals';
|
|
|
|
// Mock localStorage
|
|
const createLocalStorageMock = () => {
|
|
let store = {};
|
|
return {
|
|
getItem: (key) => store[key] || null,
|
|
setItem: (key, value) => {
|
|
store[key] = value.toString();
|
|
},
|
|
removeItem: (key) => {
|
|
delete store[key];
|
|
},
|
|
clear: () => {
|
|
store = {};
|
|
},
|
|
get length() {
|
|
return Object.keys(store).length;
|
|
},
|
|
key: (index) => Object.keys(store)[index] || null
|
|
};
|
|
};
|
|
|
|
const localStorageMock = createLocalStorageMock();
|
|
|
|
Object.defineProperty(window, 'localStorage', {
|
|
value: localStorageMock,
|
|
writable: true
|
|
});
|
|
|
|
// Reset localStorage before each test
|
|
beforeEach(() => {
|
|
localStorageMock.clear();
|
|
});
|