Skip to content

rtutin/param-editor-test

Repository files navigation

🚀 Быстрый старт

npm i && npm test && npm run dev

Установка зависимостей

npm install
# или
yarn install
# или
bun install

Разработка

Запуск dev сервера на http://localhost:5173:

npm run dev

Тестирование

Запуск всех unit-тестов:

npm test

Интерактивный режим с UI:

npm run test:ui

Сборка

npm run build

📊 Результаты тестов

✓ src/ParamEditor.test.tsx (58 tests)
  ✓ Rendering (4)
    ✓ should render all parameters from params array
    ✓ should render input fields for string type parameters
    ✓ should display parameter type in label
    ✓ should render empty message when no parameters provided
  ✓ Initialization (3)
    ✓ should initialize input values from model.paramValues
    ✓ should initialize with empty string if paramValue not found
    ✓ should handle empty paramValues array
  ✓ User Interactions (3)
    ✓ should update input value when user types
    ✓ should handle multiple parameter changes
    ✓ should handle clearing input values
  ✓ getModel() Method (6)
    ✓ should return model with updated paramValues
    ✓ should reflect changes in getModel() after user input
    ✓ should preserve colors from original model
    ✓ should handle empty colors array
    ✓ should include all paramIds even with empty values
  ✓ Props Updates (1)
    ✓ should handle new parameters added to props
  ✓ Type Safety and Edge Cases (3)
    ✓ should handle special characters in parameter values
    ✓ should handle unicode characters
    ✓ should handle very long strings
  ✓ State Management (2)
    ✓ should maintain separate state for each input
    ✓ should not mutate original model prop

Tests: 25 passed
Run time: ~500ms

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors