forked from spirit-drive/react-start-template
-
Notifications
You must be signed in to change notification settings - Fork 63
Homework jest test #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
IvanDetch
wants to merge
11
commits into
React-js-OTUS:main
Choose a base branch
from
IvanDetch:homework-jest-test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Task: https://otus.ru/learning/335195/#/homework-chat/37438/

Screenshots:
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 балл)