Skip to content

Instantly share code, notes, and snippets.

View Robdel12's full-sized avatar
🏁
Making a PitStop

Robert DeLuca Robdel12

🏁
Making a PitStop
View GitHub Profile
import Interactor, {
attribute,
property,
clickable,
focusable,
blurrable,
is
} from "@bigtest/interactor";
@Interactor.extend
describe("Checkbox", () => {
let checkbox = new CheckboxInteractor("label");
//...previous test
it("has the right tabindex", async () => {
await mount(() => <Checkbox tabIndex="2" />);
expect(checkbox.tabIndex).toBe("2");
});
//...typical imports
import { mount } from '@bigtest/react';
import CheckboxInteractor from './interactor';
describe("Checkbox", () => {
let checkbox = new CheckboxInteractor("label");
it("calls onFocus() when focus is set", async () => {
let handleFocus = jest.fn();
import Interactor, { is, focusable } from '@bigtest/interactor';
@Interactor.extend
class CheckboxInteractor {
hasFocus = is("input", ":focus");
focusCheckbox = focusable("input");
}
// You can use `@bigtest/interactor` without a
// decorator by passing a POJO to `Interactor.from`
@Robdel12
Robdel12 / jest-and-interactor.md
Last active October 28, 2018 19:04
Using Jest and BigTest Interactors together to write kickass component tests!

Jest + BigTest Interactor = Component Test ❤️

Over the past year, my friend Wil and I have been building an acceptance testing library for single page apps called BigTest. We strongly feel the highest value tests you can write are ones that run in different browsers and test the whole application together.

While building out BigTest Wil wrote a library called interactor (@bigtest/interactor). You can think about interactors as composable page objects that are super fast. They wait for the element to be present before interacting, so you don’t have to put any sleeps in or sync up with any run loops. It also has a super-expressive API that makes writing complex tests more readable and maintainable.

The best part about interactors is they are composable so you can build on top of other interactors. Another great thing is you can use them anywhere there’s DOM. They were specifically built

@Robdel12
Robdel12 / checkbox.test.js
Last active October 27, 2018 23:19
@bigtest/interactor with Jest to test React components
import React from "react";
import { mount } from "@bigtest/react";
import {
interactor,
attribute,
property,
clickable,
focusable,
blurrable,
is

Microstates Roadmap Meeting

What needs to get done for v1?

Notes

  • Guides
  • Docs
  • Use microstates in projects
    • Need to find a production app to get Microstates into
  • Focus on the on boarding

BigTest Roadmap notes

What needs to get done for v1?

Notes

  • Guides
  • Tutorials
  • BigTest React helpers
  • We need a visit helper for all the frameworks
  • Update docs site / remove the current doc generator site
@Robdel12
Robdel12 / conferences.md
Last active April 4, 2018 05:57
List of conferences that are related to JavaScript / Frontend (with CFPs)
import React, { Component } from 'react'
class App extends Component {
render() {
let isCondition = false;
let Component = isCondition ? <OneComponent /> : <AnotherComponent />;
return (
<div>
<Component />