Skip to content

Conversation

@IvanDetch
Copy link

Task: https://otus.ru/learning/335195/#/homework-chat/37438/
Screenshots:
image

Git: https://github.com/IvanDetch/IvanDetch.github.io/tree/homework-jest-test
Score: 10 / 10
-[x] Написание тестов для логики скидок (3 балла)
-[x] Реализация класса AccountService (3 балла)
-[x] Качество написания тестов (2 балла)
-[x] Качество кода и соответствие стандартам (1 балл)
-[x] Корректность работы прикладного слоя (1 балл)

Ivan Komrakov and others added 11 commits March 11, 2025 23:07
feat: modify style App.css
feat: modify package.json
feat: modify webpack.config.json
…f, transactionFull, addToCartButton, cartItem, productBrief, productFull.
feat: (i18n) wrap stories with LocalizationProvider

refactor: (header) memoize Header and group controls

chore: (storybook) migrate Header stories to CSF3 render

feat: (modal) autofocus input on open via useRef

perf: (ui) memoize LanguageToggle and ThemeToggle
feat(ui/modal): implement portal mount to body with ESC close and backdrop click
feat(lib): add random data generators for Product and Operation
feat(ecommerce/product-list): render products array via ProductBrief
feat(ecommerce/product-list): append items by "show more" button
feat(ecommerce/product-list): auto-load next page via IntersectionObserver
feat(finance/operation): add Operation and OperationFull components
feat(finance/operation-list): implement infinite list with IO and "show more"
feat(storybook): add ProductList playground with generatedCount and pageSize controls
feat(storybook): add OperationList playground with generatedCount and pageSize controls
feat(patterns/list): add generic List with function-as-children and renderEmpty
feat(shared/hooks): add useIntersection hook for infinite loading
feat(ecommerce/product-list-pattern): add ProductListPattern with renderItem and IO-based infinite scroll
feat(storybook): add ProductListPattern stories with generatedCount/pageSize/useInfinite controls

feat(ecommerce/product-brief): support actions slot via children and spread HTML props
fix(ecommerce/product-brief): replace default AddToCartButton with children fallback to avoid duplicates

feat(ui/modal): add renderTrigger API while keeping controlled mode and ESC/backdrop close
feat(ui/modal): add focus trap, restoreFocus, initialFocusRef and disableBackdropClose

feat(ui/theme-toggle): support controlled/uncontrolled over ThemeProvider (state hoisting)

feat(ecommerce/add-to-cart-button-pattern): support controlled/uncontrolled, onChange/onAdd/onIncrease/onDecrease and forwardRef
feat(storybook): add AddToCartButtonPattern stories for controlled and uncontrolled modes

feat(ecommerce/cart-item-pattern): support controlled/uncontrolled qty, onQuantityChange/onRemove and renderActions prop; improve a11y
feat(storybook): add CartItemPattern stories (Uncontrolled, Controlled, WithCustomActions)

feat(components/index): export List and ProductListPattern
feat(storybook): add Modal “Focus & Restore” story to demonstrate focus management
feat(complex/component-info): add ComponentInfo with title/desc/fullWidth and css-modules
feat(storybook): add ComponentInfo stories (default, full width)

feat(complex/infinity-list): implement virtualized bidirectional list with overscan/reserve, start/end loaders, height prop and scrollTo api
feat(complex/infinity-list): integrate ResizeObserver with rAF throttling and preserve scroll position on prepend
feat(storybook): add InfinityList stories using ComponentInfo with controls (height, itemHeight, reserve, overscan, generatedCount, timeout)

feat(complex/cropped-text): add CroppedText with binary-search truncation by rows and customizable ellipsis
feat(complex/cropped-text): integrate ResizeObserver to recalc on width change
feat(storybook): add CroppedText stories (default, responsive width, opened) using ComponentInfo

feat(components/index): export ComponentInfo, InfinityList and CroppedText
feat(forms/rhf): migrate forms to React Hook Form + Yup (Profile/Product/Operation/Auth)
feat(forms/extra): add ChangePasswordForm, EmailForm, RepeatPasswordForm
feat(ui/forms): add TextField/TextAreaField/SelectField/PasswordField (forwardRef)
feat(validation): add shared Yup schemas (email/password/name/phone/price/amount/date)
feat(styles): add Panda-like tokens and base classes (btn/card/page)
feat(pages): add Login/Register/Profile/ProductEditor/OperationEditor pages
feat(storybook): add stories for all forms and Pages Gallery (fullscreen)
feat(service/account): add accountservice with global and per-product discounts

feat(service/account): introduce discount repository and in-memory implementation

test(account): cover core discount logic with in-memory repository

test(account): add jest mocks for repository, verify calls and error paths

feat(dev/storybook): add discount admin panel and preview with shared service

chore(storybook): add combined playground story for admin+preview
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant