Unit-тесты Jest TDD Snapshot E2E-тесты Как работает Скриншоты Opensource Commits, pull-requests, issues Просмотр кода на github
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
| const GenericTemplate = ({ children, hero }) => { | |
| return ( | |
| <Container> | |
| <Header /> | |
| {hero} | |
| {children} | |
| <Footer /> | |
| </Container> | |
| ) | |
| } |
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
| // test https://github.com/bogdanq/jest-testing/blob/master/src/components/testing-library/components/conditional-list/conditional-list.spec.js | |
| import React from 'react' | |
| import { Spiner } from '@ui' | |
| export const ConditionalList = ({ data, renderExist, renderEmpty, error, loading }) => { | |
| if (!data) { | |
| return <h1>Данных нет</h1>; | |
| } | |
| if (error) { |
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
| export const Access = ({ guards = [], children, name = "" }) => { | |
| const { checkPermissions } = usePermissions(); | |
| const { loading } = useUser(); | |
| const { hiddenPages, hiddenComponents } = React.useContext( | |
| configContext, | |
| ); | |
| const hasCompletedGuards = React.useMemo(() => checkPermissions(guards), [ | |
| guards, | |
| checkPermissions, |
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
| export const WithAccount = ({ renderExists, renderEmpty, render }) => { | |
| const { user } = $userStore() | |
| if (user && renderExists) { | |
| return renderExists({ account: user, accountId: user.id }) | |
| } | |
| if (!user && renderEmpty) { | |
| return renderEmpty({ account: null, accountId: null }) | |
| } |
NewerOlder