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 () => { |
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 |
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 |
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 | |
// - XState (all XState exports) |
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 | |
Unauthenticated* | |
Check Credentials -> Authenticating | |
Authenticating | |
Authentication Success -> Authorized | |
Authentication Failure -> Unauthorized | |
Unauthorized | |
Authorized | |
Unauthorized -> Unauthorized | |
Dashboard&* |
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
// tslint:disable:object-literal-sort-keys | |
interface MinorHierarchy<T> { | |
one: T | |
two: T | |
three: T | |
four: T | |
} | |
export const createMinorHierarchy = <T>( |
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
Enrollment wizard | |
Visitor?* | |
Get prospect id? -> Prospect id request? | |
Has prospect id? -> Prospect details request? | |
Error | |
Return to enrollment -> Visitor? | |
Prospect id request? | |
Success? -> Prospect enrollment |
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
Enrollment wizard | |
Visitor?* | |
Get prospect id? -> Prospect id request? | |
Error | |
Return to enrollment -> Visitor? | |
Prospect id request? | |
Success? -> Prospect enrollment | |
Failure? -> Error |
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
// This assumes Styled Components is in play, as well. | |
// | |
// Here we have the (too simple) React component which | |
// we'll be rendering content into. | |
// | |
class Underlined extends React.Component<any, any> { | |
public hole: HTMLElement | null | |
// We'll put the content into what we render using |
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
Login | |
Incomplete form* | |
Empty* | |
Add username -> Username filled out | |
Add password -> Password filled out | |
Submit -> Empty | |
Username filled out | |
Add password -> All fields filled out | |
Submit -> Username required prompt | |
Password filled out |