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 OLD = { | |
| image: { __typename__: 'Image' }, | |
| sprites: [ | |
| { x: 0, y: 0, width: 2, height: 2 }, | |
| { x: 0, y: 0, width: 2, height: 23 }, | |
| { x: 0, y: 0, width: 2, height: 36 }, | |
| { x: 0, y: 0, width: 2, height: 42 }, | |
| { x: 0, y: 0, width: 2, height: 48 }, | |
| { x: 0, y: 0, width: 2, height: 140 }, | |
| { x: 0, y: 0, width: 2, height: 129 }, |
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 JSONContentMock: JSONContent = { | |
| doc: { | |
| type: 'doc', | |
| content: [ | |
| { | |
| type: 'heading', | |
| attrs: { level: 1 }, | |
| content: [{ type: 'text', text: 'Title' }], | |
| }, | |
| { |
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 students = [ | |
| { name: 'Alice', age: 20, grade: 4.5 }, | |
| { name: 'Bob', age: 21, grade: 3.9 }, | |
| { name: 'Charlie', age: 19, grade: 4.8 }, | |
| ]; | |
| const calculateAverageGrade = (studentArgument) => { | |
| let result = 0; | |
| // сумма всех баллов (версия 1) |
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
| import { ApolloClient, gql, useApolloClient } from '@apollo/client'; | |
| import Uppy from '@uppy/core'; | |
| // https://github.com/uuidjs/uuid#getrandomvalues-not-supported | |
| import 'react-native-get-random-values'; | |
| import { v4 as uuidv4 } from 'uuid'; | |
| import { translateScalar } from '@landr/mfe/src/utils/translateScalar'; | |
| import { useMemo } from 'react'; | |
| import { FileUploaderProps } from '@landr/mfe'; | |
| import { useFileUploader } from '@landr/mfe/src/customHooks/useFileUploader'; | |
| import * as DocumentPicker from 'expo-document-picker'; |
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
| expect(result.current.isTrue).toBe(false); | |
| - await waitForNextUpdate(); | |
| + await waitForNextUpdate({ | |
| + timeout: 2500, | |
| + }); | |
| expect(result.current.isTrue).toBe(true); | |
| }); |
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
| useEffect(() => { | |
| const id = setTimeout(() => { | |
| setIsTrue(true); | |
| - }, 1000); | |
| + }, 2000); | |
| return () => { | |
| clearTimeout(id); |
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
| import { renderHook, act } from '@testing-library/react-hooks'; | |
| import { useSimplestHook } from './1.simplest-hook'; | |
| it('should set to true', () => { | |
| const { result } = renderHook(() => useSimplestHook()); | |
| expect(result.current.isTrue).toBe(false); | |
| act(() => { | |
| result.current.toggle(); |
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
| import { useEffect, useState } from 'react'; | |
| export const useSimplestHook = () => { | |
| const [isTrue, setIsTrue] = useState(false); | |
| useEffect(() => { | |
| const id = setTimeout(() => { | |
| setIsTrue(true); | |
| }, 1000); |
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
| title: 'Flutter Demo', | |
| theme: ThemeData( | |
| primarySwatch: Colors.blue, | |
| + pageTransitionsTheme: const PageTransitionsTheme(builders: { | |
| + TargetPlatform.android: CupertinoPageTransitionsBuilder(), | |
| + TargetPlatform.iOS: FadeUpwardsPageTransitionsBuilder(), | |
| + TargetPlatform.fuchsia: CupertinoPageTransitionsBuilder(), | |
| + TargetPlatform.linux: CupertinoPageTransitionsBuilder(), | |
| + TargetPlatform.windows: CupertinoPageTransitionsBuilder(), | |
| + TargetPlatform.macOS: CupertinoPageTransitionsBuilder(), |
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
| title: 'Flutter Demo', | |
| theme: ThemeData( | |
| primarySwatch: Colors.blue, | |
| + pageTransitionsTheme: const PageTransitionsTheme(builders: { | |
| + TargetPlatform.android: CupertinoPageTransitionsBuilder(), | |
| + }), | |
| ), | |
| initialRoute: '/', | |
| routes: { |
NewerOlder