View create-user.spec.tsx
This file contains 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 { render } from '@testing-library/react'; | |
import userEvents from '@testing-library/user-event'; | |
import { useState } from 'react'; | |
function usePassword() { | |
const [password, setPassword] = useState(''); | |
const [show, setShow] = useState(false); | |
const toggle = () => setShow((previousShowValue) => !previousShowValue); | |
const update = (event: React.ChangeEvent<HTMLInputElement>) => |
View paths.ts
This file contains 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
type GetKeypaths< | |
GivenType, | |
Filter extends string = '___!!!PLACEHOLDER!!!___' | |
> = GivenType extends object | |
? keyof GivenType extends string | |
? keyof GivenType extends Filter | |
? GetKeypaths<GivenType[keyof GivenType], Filter> | |
: | |
| keyof GivenType | |
| `${keyof GivenType}.${GetKeypaths< |
View SketchSystems.spec
This file contains 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
App | |
Checking Credentials | |
Identity Present -> Home Page | |
Identity Absent -> Registration | |
Registration | |
Check for Identity Info | |
Identity Info Present -> Registration Credentials Form | |
Identity Info Absent -> Identity Info Form | |
Identity Info Form | |
Input Identity Info -> Validating Identity Info |
View toggle.spec.tsx
This file contains 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
/* eslint-disable @typescript-eslint/require-await */ | |
import { render } from '@testing-library/react'; | |
import userEvent from '@testing-library/user-event'; | |
import { createContext, useContext, useReducer } from 'react'; | |
type Events = { type: 'toggle' } | { type: 'reset' }; | |
interface EventMap { | |
toggle: () => void; | |
reset: () => void; | |
} |
View machine.js
This file contains 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
View SketchSystems.spec
This file contains 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
Touchpoint Dashboard | |
Loading | |
Success -> Authenticating | |
Failure -> Unable to Load | |
Unable to Load | |
Retry -> Loading | |
Authenticating | |
Checking Credentials | |
No Credentials -> Login | |
Credentials Exist -> Verify Credentials |
View SketchSystems.spec
This file contains 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
Touchpoint Dashboard | |
Loading* | |
Success -> Authenticating | |
Failure -> Unable to Load | |
Unable to Load | |
Retry -> Loading | |
Authenticating | |
Checking Credentials? | |
No Credentials -> Login | |
Credentials Exist -> Authenticate |
View SketchSystems.spec
This file contains 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
Widget& | |
Async | |
Pending | |
Fetch -> Fetching | |
Fetching | |
Resolved -> Success | |
Rejected -> Failure | |
Success | |
Fetch -> Fetching | |
Failure |
View App.test.tsx
This file contains 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 React from 'react'; | |
import { render, fireEvent } from '@testing-library/react'; | |
import App, { AppContext } from './App'; | |
const SpiesOnApp = () => { | |
const context = React.useContext(AppContext); | |
return <>{JSON.stringify(context)}</>; | |
}; | |
test('tracks username', async () => { |
View SketchSystems.spec
This file contains 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
Explorer | |
Uninitialized | |
Rehydrate -> Ready | |
Ready& | |
Requesting -> Ready | |
Results | |
Idle | |
Requesting -> Loading | |
Loading | |
Success -> Idle |
NewerOlder