# @mojotech/prismatest-css

> CSS adapter for use with @mojotech/prismatest.

Latest version **0.4.6** (published 2020-02-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mojotech/prismatest-css
pnpm add @mojotech/prismatest-css
yarn add @mojotech/prismatest-css
bun add @mojotech/prismatest-css
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.6 |
| Published | 2020-02-28 |
| First published | 2019-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mojotech |
| Maintainers | cpjolicoeur, danielwilsonthomas-mj, mulias |

## Links

- npm: https://www.npmjs.com/package/@mojotech/prismatest-css
- npm.io page: https://npm.io/package/@mojotech/prismatest-css

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^16.8.6
- [react-dom](https://npm.io/package/react-dom.md) ^16.8.6
- [@mojotech/prismatest](https://npm.io/package/@mojotech/prismatest.md) ^0.3.1

## Recent versions

- 0.4.6 (latest) — 2020-02-28
- 0.4.5 — 2019-09-11
- 0.4.4 — 2019-09-11
- 0.4.3 — 2019-08-28
- 0.4.2 — 2019-08-27
- 0.4.1 — 2019-08-26
- 0.4.0 — 2019-08-26
- 0.3.2 — 2019-07-07
- 0.3.1 — 2019-07-05
- 0.3.0 — 2019-07-01
- 0.2.0 — 2019-06-24
- 0.1.0 — 2019-06-23

## README

# 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](https://developer.mozilla.org/en-US/docs/Web/API/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

    ```bash
    yarn install --dev @mojotech/prismatest-css
    ```

2. Render something

    ```javascript
    import App from "./app";
    import * as ReactDOM from 'react-dom';

    const rendered  = document.createElement('div');
    ReactDOM.render(<App />, domContainer);
    ```

3. Use some test views

    ```javascript
    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();
    ```

---
_Source: https://npm.io/package/@mojotech/prismatest-css · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
