@helpscout/cyan
    TypeScript icon, indicating that this package has built-in type declarations

    0.12.1 • Public • Published

    🐱 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!

    Install

    npm i @helpscout/cyan

    DownloadsWeekly Downloads

    37

    Version

    0.12.1

    License

    MIT

    Unpacked Size

    177 kB

    Total Files

    118

    Last publish

    Collaborators

    • charca
    • helpscout
    • itsjonq
    • knicklabs
    • plbabin
    • tinkertrain