Skip to content

Commit

Permalink
lowercase enzyme
Browse files Browse the repository at this point in the history
  • Loading branch information
lelandrichardson committed Sep 26, 2017
1 parent 94ec3ce commit cd8a2c7
Show file tree
Hide file tree
Showing 19 changed files with 107 additions and 107 deletions.
2 changes: 1 addition & 1 deletion docs/api/render.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Static Rendering API

Enzyme's `render` function is used to render react components to static HTML and analyze the
enzyme's `render` function is used to render react components to static HTML and analyze the
resulting HTML structure.

`render` returns a wrapper very similar to the other renderers in enzyme, [`mount`](mount.md) and
Expand Down
14 changes: 7 additions & 7 deletions docs/api/selector.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Enzyme Selectors
# enzyme Selectors

Many methods in Enzyme's API accept a *selector* as an argument. Selectors in Enzyme can fall into
Many methods in enzyme's API accept a *selector* as an argument. Selectors in enzyme can fall into
one of the following four categories:


### 1. A Valid CSS Selector

Enzyme supports a subset of valid CSS selectors to find nodes inside a render tree. Support is as
enzyme supports a subset of valid CSS selectors to find nodes inside a render tree. Support is as
follows:

- class syntax (`.foo`, `.foo-bar`, etc.)
Expand Down Expand Up @@ -40,7 +40,7 @@ input#input-name
label[foo=true]
```

Enzyme also gives support for the following contextual selectors
enzyme also gives support for the following contextual selectors

```
.foo .bar
Expand All @@ -60,7 +60,7 @@ enzyme that will likely be focused on in the future.

### 2. A React Component Constructor

Enzyme allows you to find components based on their constructor. You can pass in the reference to
enzyme allows you to find components based on their constructor. You can pass in the reference to
the component's constructor:

```jsx
Expand All @@ -76,7 +76,7 @@ const myComponents = wrapper.find(MyComponent);

### 3. A React Component's displayName

Enzyme allows you to find components based on a component's `displayName`. If a component exists
enzyme allows you to find components based on a component's `displayName`. If a component exists
in a render tree where its `displayName` is set and has its first character as a capital letter,
a string can be used to find it:

Expand All @@ -99,7 +99,7 @@ selector using the tag syntax.

### 4. Object Property Selector

Enzyme allows you to find components and nodes based on a subset of their properties:
enzyme allows you to find components and nodes based on a subset of their properties:


```jsx
Expand Down
8 changes: 4 additions & 4 deletions docs/common-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ selectors we currently support: https://github.com/airbnb/enzyme/blob/master/doc

### Testing third party libraries

Some third party libraries are difficult or impossible to test. Enzyme's scope is severly limited to what
React exposes and provides for us. Things like "portals" are not currently testable with Enzyme directly for that reason.
Some third party libraries are difficult or impossible to test. enzyme's scope is severly limited to what
React exposes and provides for us. Things like "portals" are not currently testable with enzyme directly for that reason.

An example:

If you are testing a library that creates a Modal, and it manually appends it to a different part of the DOM, React has lost
track of this component, and therefore Enzyme has also lost track of it.
track of this component, and therefore enzyme has also lost track of it.

Even more so, if this library appends dom elements into react components, react still does not know about it. A library like d3 which
appends DOM elements would be an example here.
Expand All @@ -28,7 +28,7 @@ appends DOM elements would be an example here.
You can use the `render` API to attempt to access and assert on the appended DOM components. This will likely become natively supported
when React natively supports Portals, which is expected to land with Fiber.

If the third party solution lets you attach a `ref`, that would be the ideal scenario. With a `ref` you can then get that element from Enzyme.
If the third party solution lets you attach a `ref`, that would be the ideal scenario. With a `ref` you can then get that element from enzyme.

example

Expand Down
4 changes: 2 additions & 2 deletions docs/future.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Discussion of additional features and support for enzyme should be initiated by opening a
[Github issue](https://github.com/airbnb/enzyme/issues).

There are several things we'd like to address with Enzyme that often get asked. Here are a couple
There are several things we'd like to address with enzyme that often get asked. Here are a couple
of projects that we plan on addressing in the near future:


Expand All @@ -17,5 +17,5 @@ interaction.
### Improved Keyboard + Mouse Simulation

Many react components involve simulating form input or complex mouse interaction. Simulating this
using the event simulation API that Enzyme provides is cumbersome and impractical. We are looking for
using the event simulation API that enzyme provides is cumbersome and impractical. We are looking for
an expressive way to solve this problem, even if it is a library that lives outside of enzyme.
20 changes: 10 additions & 10 deletions docs/guides.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Enzyme Guides
# enzyme Guides

- [*Using Enzyme with Browserify*](guides/browserify.md)
- [*Using Enzyme with WebPack*](guides/webpack.md)
- [*Using Enzyme with JSDOM*](guides/jsdom.md)
- [*Using Enzyme with Jest*](guides/jest.md)
- [*Using Enzyme with Karma*](guides/karma.md)
- [*Using Enzyme with Mocha*](guides/mocha.md)
- [*Using Enzyme with React Native*](guides/react-native.md)
- [*Using Enzyme with Lab*](guides/lab.md)
- [*Using Enzyme with Tape and AVA*](guides/tape-ava.md)
- [*Using enzyme with Browserify*](guides/browserify.md)
- [*Using enzyme with WebPack*](guides/webpack.md)
- [*Using enzyme with JSDOM*](guides/jsdom.md)
- [*Using enzyme with Jest*](guides/jest.md)
- [*Using enzyme with Karma*](guides/karma.md)
- [*Using enzyme with Mocha*](guides/mocha.md)
- [*Using enzyme with React Native*](guides/react-native.md)
- [*Using enzyme with Lab*](guides/lab.md)
- [*Using enzyme with Tape and AVA*](guides/tape-ava.md)
6 changes: 3 additions & 3 deletions docs/guides/browserify.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Using Enzyme with Browserify
# Using enzyme with Browserify

If you are using a test runner that runs code in a browser-based environment, you may be using
[browserify](http://browserify.org/) in order to bundle your React code.

Prior to Enzyme 3.0 there were some issues with conditional requires that were used
to maintain backwards compatibility with React versions. With Enzyme 3.0+, this
Prior to enzyme 3.0 there were some issues with conditional requires that were used
to maintain backwards compatibility with React versions. With enzyme 3.0+, this
should no longer be an issue. If it is, please file a GitHub issue or make a PR
to this documentation with instructions on how to set it up.
8 changes: 4 additions & 4 deletions docs/guides/jest.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Using Jest with Enzyme
# Using Jest with enzyme

## Jest version 15 and up

Starting with version 15, Jest [no longer mocks modules by default](https://facebook.github.io/jest/blog/2016/09/01/jest-15.html). Because of this, you no longer have to add _any_ special configuration for Jest to use it with Enzyme.
Starting with version 15, Jest [no longer mocks modules by default](https://facebook.github.io/jest/blog/2016/09/01/jest-15.html). Because of this, you no longer have to add _any_ special configuration for Jest to use it with enzyme.

Install Jest, and its Babel integrations, as recommended in the [Jest docs](https://facebook.github.io/jest/docs/getting-started.html). Install Enzyme. Then, simply require/import React, Enzyme functions, and your module at the top of a test file.
Install Jest, and its Babel integrations, as recommended in the [Jest docs](https://facebook.github.io/jest/docs/getting-started.html). Install enzyme. Then, simply require/import React, enzyme functions, and your module at the top of a test file.

```js
import React from 'react';
Expand All @@ -21,7 +21,7 @@ You do **not** need to include Jest's own renderer, unless you want to use it _o

## Jest prior to version 15

If you are using Jest 0.9 – 14.0 with Enzyme and using Jest's automocking feature, you will need to mark react and enzyme to be unmocked in your `package.json`:
If you are using Jest 0.9 – 14.0 with enzyme and using Jest's automocking feature, you will need to mark react and enzyme to be unmocked in your `package.json`:

`package.json`:
```json
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/jsdom.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Using Enzyme with JSDOM
# Using enzyme with JSDOM

[JSDOM](https://github.com/tmpvar/jsdom) is a JavaScript based headless browser that can be used to create a realistic testing environment.

Expand Down
8 changes: 4 additions & 4 deletions docs/guides/karma.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Using Enzyme with Karma
# Using enzyme with Karma

Karma is a popular test runner that can run tests in browser environments. Enzyme is compatible with
Karma is a popular test runner that can run tests in browser environments. enzyme is compatible with
Karma, but often requires a little bit of configuration.

This configuration largely depends on which plugins you are using to bundle your JavaScript code. In
the case of Browserify or Webpack, see the below documentation in order to get these up and running.


## Enzyme + Karma + Webpack
## enzyme + Karma + Webpack

See the [webpack guide](webpack.md).

Expand All @@ -34,7 +34,7 @@ module.exports = function karmaConfig(config) {
};
```

## Enzyme + Karma + Browserify
## enzyme + Karma + Browserify

See the [browserify guide](browserify.md).

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/lab.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Using Enzyme with Lab and Code
# Using enzyme with Lab and Code

[Lab](https://github.com/hapijs/lab) is a simple test utility for node & part of the [Hapi.js](https://github.com/hapijs/hapi) framework universe. Lab's initial code borrowed heavily from [Mocha](https://github.com/mochajs/mocha). [Code](https://github.com/hapijs/code) is Lab's standard assertion library and was created as a direct rewrite of [Chai](https://github.com/chaijs).


# Example Test: Enzyme + Lab + Code
# Example Test: enzyme + Lab + Code

```jsx
import { shallow, mount, render } from 'enzyme';
Expand Down
Loading

0 comments on commit cd8a2c7

Please sign in to comment.