Skip to content

Instantly share code, notes, and snippets.

View shawn-sandy's full-sized avatar
💭
I may be slow to respond.

Shawn Sandy shawn-sandy

💭
I may be slow to respond.
View GitHub Profile
const nextJest = require('next/jest')
const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: './',
})
// Add any custom config to be passed to Jest
const customJestConfig = {
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
"use strict";
const matter = [
null,
null,
null,
{
title: "Advanced title",
description: "Some advance story",
date: "2023-01-22T23:51:45.574Z",
@shawn-sandy
shawn-sandy / associative-array.ts
Last active September 2, 2023 19:46
typescript
// create a javascript type for and associative array
type AssocArray = {
[key: string]: string;
};
// use the type to create an associative array
const myArray: AssocArray = {
"key1": "value1",
"key2": "value2",
import { Button } from './button'
import { BADGE } from '@geometricpanda/storybook-addon-badges'
import '@shawnsandy/first-paint/dist/css/components/button.min.css'
import { userEvent, screen, waitFor } from '@storybook/testing-library'
import { expect } from '@storybook/jest'
export default {
title: 'FP.React Components/Buttons',
component: Button,
# developer-portal-tab-container
import React from 'react'
import COMPONENT_NAME from './component-name'
import { ComponentStory, ComponentMeta } from "@storybook/react"
import { BADGE } from '@geometricpanda/storybook-addon-badges';
export default {
title: 'Elements/COMPONENT_NAMEs',
component: COMPONENT_NAME,
argTypes: {
/**
* ! issues calling onFailure
*/
useEffect(() => {
if (atsProgressStatus === 'INVALID_CREDENTIALS') {
callOnFailure();
next();
// onFailure();
console.log({ atsProgressStatus });
@shawn-sandy
shawn-sandy / diagrams.md
Last active July 12, 2022 20:56
Diagrams

‎‎​

// NOTE: this definitely is not working correctly, but is relatively close to what needs to be done
useEffect(() => {
if (existingIntegration) {
return;
}
if (atsLinkStatus === ExternalAtsLinkStatusKind.InvalidCredentials) {
onApiFailure();
} else {
// @ts-ignore
import React from 'react';
import { describe, expect, test, it } from 'vitest';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import App from '../App'
describe('App renders correctly', () => {