A Cypress test checking the most common issues faced by Conio with the AWS/S3 management (with a custom configuration for Brotli)
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
#!/bin/bash | |
branchname=${1:-$(git rev-parse --abbrev-ref HEAD)} | |
if ! [ -x "$(command -v jq)" ]; then | |
echo 'Error: "jq" is not installed.' >&2 | |
exit 1 | |
fi | |
if [ ! $SECRET_GH_TOKEN ]; then |
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
const internalFlexRoute = curry((httpVerb: string, route: string) => { | |
return cy.route(httpVerb, route); | |
}); | |
const flexRoute = curry((httpVerb: string, route: string, response: object) => { | |
const route = internalFlexroute(httpVerb, route); | |
return route(response); | |
}); |
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 { omit } from "lodash/fp"; | |
import { Machine, assign } from "xstate"; | |
import { dataMachine } from "./dataMachine"; | |
import { httpClient } from "../utils/asyncUtils"; | |
import { User } from "../models"; | |
export interface CreateTransactionMachineSchema { | |
states: { | |
stepOne: {}; | |
stepTwo: {}; |
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, { useState, useEffect } from "react"; | |
import { connect } from "react-redux"; | |
import { IRootReducerState } from "../reducers"; | |
import { User, TransactionPayload } from "../models"; | |
import TransactionCreateStepOne from "../components/TransactionCreateStepOne"; | |
import TransactionCreateStepTwo from "../components/TransactionCreateStepTwo"; | |
import { usersSearchPending } from "../actions/users"; | |
import { useMachine } from "@xstate/react"; | |
import { createTransactionMachine } from "../machines/createTransactionMachine"; |
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
const dataMachine = Machine({ | |
id: "dataMachine", | |
initial: "idle", | |
context: { | |
pageData: {}, | |
results: [] | |
}, | |
states: { | |
idle: { | |
on: { |
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
import expect from "expect"; | |
import sinon from "sinon"; | |
// Inline version of function to be tested | |
const expiredOrExpiresWithin = (decodedJwt, seconds) => | |
Date.now() >= (decodedJwt.exp + (-Math.abs(seconds) || 0)) * 1000; | |
describe("jwtUtils", () => { | |
describe("expiredOrExpiresWithin", () => { | |
let clock; |
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
module.exports = function(duration) { | |
return function(){ | |
return new Promise(function(resolve, reject){ | |
setTimeout(function(){ | |
resolve(); | |
}, duration) | |
}); | |
}; | |
}; |