@mojotech/prismatest-css
TypeScript icon, indicating that this package has built-in type declarations

0.4.6 • Public • Published

Prismatest CSS Adapter

This adapter is used to interact with your test views using CSS selectors and native DOM APIs.

Element Type

Elements are native HTMLElement instances. They may be more specific depending on the element that is selected.

Selector Type

Selectors are specified using CSS selector fragments. When selectors are combined they are joined with a space. If multiple CSS selector fragments are specified in a single string using commas, then when they are combined the fragments are split, combined with the next selector, and rejoined using commas. This is effectively a cartesian product.

Quick Start

  1. Install

    yarn install --dev @mojotech/prismatest-css
  2. Render something

    import App from "./app";
    import * as ReactDOM from 'react-dom';
    
    const rendered  = document.createElement('div');
    ReactDOM.render(<App />, domContainer);
  3. Use some test views

    import testView from "@mojotech/prismatest-css";
    import TodoComponent from './todo-component';
    
    const TodoView = testView('#todo-component');
    
    const todoInput = TodoView(testView.defaultViews.textInput).materialize(rendered);
    const todoSubmit = TodoView(testView.defaultViews.button).materialize(rendered);
    
    todoInput.enterText("Write some tests!");
    todoSubmit.click();

Readme

Keywords

none

Package Sidebar

Install

npm i @mojotech/prismatest-css

Weekly Downloads

8

Version

0.4.6

License

MIT

Unpacked Size

8.42 kB

Total Files

4

Last publish

Collaborators

  • cpjolicoeur
  • danielwilsonthomas-mj
  • mulias