🚀 DAY 4 OF LAUNCH WEEK: Introducing GitHub Actions Scanning Support.Learn more
Socket
Book a DemoInstallSign in
Socket

@helpscout/cyan

Package Overview
Dependencies
Maintainers
6
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@helpscout/cyan

Cypress-like Testing for React + JSDOM

latest
Source
npmnpm
Version
0.12.1
Version published
Weekly downloads
775
652.43%
Maintainers
6
Weekly downloads
 
Created
Source

🐱 Cyan

Build Status Coverage Status npm version

Cypress-like Testing for React + JSDOM

Table of Contents

Installation

npm install --save-dev @helpscout/cyan

Example

import React from 'react'
import { cy } from '@helpscout/cyan'
import Modal from '../Modal'

cy.useFakeTimers()

test('Can open/close a Modal', () => {
  cy.render(
    <Modal trigger={<button>Open</button>}>
      <div className="content">Content</div>
    </Modal>,
  )

  cy.get('button').click()

  expect(cy.get('.Modal').hasClass('is-open')).toBeTruthy()
  expect(cy.get('.content').exists()).toBeTruthy()

  cy.getByCy('CloseButton').click()

  expect(cy.get('.Modal').hasClass('is-open')).toBeFalsy()
  expect(cy.get('.content').exists()).toBeFalsy()
})

Documentation

For additional information, check out our documentation!

Keywords

cypress

FAQs

Package last updated on 21 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts