Skip to content

Instantly share code, notes, and snippets.

Avatar
🦊
Foxy fox

Vojtěch Červený vojtech-cerveny

🦊
Foxy fox
  • Ostrava, Czech Republic
View GitHub Profile
View machine.js
const incrementBack = (context) => context.back + 1;
const isAnonymous = (context) => context.anonymous === true;
const isLoggedIn = (context) => context.anonymous === false;
const adcoMachine = Machine({
id: 'wizard',
initial: 'buying_stuff',
context: {
back: 0,
modal_confirmed: null,
View machine.js
const adcoMachine = Machine({
id: 'wizard',
initial: 'start',
context: {
back: false,
},
states: {
start: {
on: {
BOM_UPLOAD: 'uploaded_bom',
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View gist:c57391969a2b8682fcfe2c164d44728d
$ yarn test:e2e
yarn run v1.21.1
$ npx wdio wdio.conf.js
Execution of 1 spec files started at 2020-06-16T11:59:11.824Z
2020-06-16T11:59:12.031Z INFO @wdio/cli:launcher: Run onPrepare hook
2020-06-16T11:59:12.035Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2020-06-16T11:59:12.036Z INFO @wdio/local-runner: Start worker 0-0 with arg: wdio.conf.js
[0-0] 2020-06-16T11:59:12.281Z INFO @wdio/local-runner: Run worker command: run
View machine.js
const feedbackMachine = Machine({
id: 'comment',
initial: 'comment_tab_closed',
context: {
text: null,
resolved: false,
hasResponses: false,
},
states: {
comment_tab_closed: {
View machine.js
const feedbackMachine = Machine({
id: 'comment',
initial: 'comment_tab_closed',
context: {
text: null,
resolved: false,
hasResponses: false,
},
states: {
comment_tab_closed: {
View cypress-stripe.js
// cypress.json
{
"chromeWebSecurity": false
}
//test.spec.js
/// <reference types="cypress" />
context('Actions', () => {
View machine.js
const feedbackMachine = Machine({
id: 'comment',
initial: 'comment_tab_closed',
//context: {
// commentWasChanged: undefined,
// commentWasDeleted: undefined,
// commentWasAdded: undefined
//},
states: {
comment_tab_closed: {
View machine.js
const feedbackMachine = Machine({
id: 'comment',
initial: 'comment_tab_closed',
//context: { wasClosed: false },
states: {
comment_tab_closed: {
on: {
OPEN_COMMENTS: 'comment_tab_opened',
},
meta: {
View MemberAdd.jsx
import React from "react";
import {
Form,
Input,
Tooltip,
Icon,
Select,
DatePicker,
Checkbox,
Button,