Skip to content

Instantly share code, notes, and snippets.

@Robdel12
Last active October 28, 2018 21:48
Show Gist options
  • Save Robdel12/0f676dc69ef32c9d9c0d0ec19e2b54ad to your computer and use it in GitHub Desktop.
Save Robdel12/0f676dc69ef32c9d9c0d0ec19e2b54ad to your computer and use it in GitHub Desktop.
//...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();
await mount(() => <Checkbox onFocus={handleFocus} />);
await checkbox.focusCheckbox();
expect(handleFocus).toBeCalled();
expect(checkbox.hasFocus).toBe(true);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment