Skip to content

Commit

Permalink
Merge pull request #3 from 14nrv/indent-README
Browse files Browse the repository at this point in the history
Improved README indentation
  • Loading branch information
mwangaben committed Mar 19, 2018
2 parents 130c5ba + a90606c commit 7f47877
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A package that aim at simplify writing your Vue test.

### How this package works:

This package depends on vue-test-utils and expect packages.
This package depends on vue-test-utils and expect packages.



Expand All @@ -23,25 +23,25 @@ $ npm install mwangaben-vthelpers
## Basic Usage

```Js
import {mount} from 'vue-test-utils';
import Questions from '../components/Questions.vue';
import { mount } from 'vue-test-utils';
import expect from 'expect';
import Helpers from 'mwangaben-vthelpers';
import Questions from '../components/Questions.vue';


describe('Questions', () => {
let wrapper, b;
let wrapper, b;

beforeEach(() => {
beforeEach(() => {
wrapper = mount(Questions);

b = new Helpers(wrapper, expect);
});
});
```
## Documentation
Note the instantiation of the Helpers class and the arguments it takes, first is wrapper and second is expect package
Note the instantiation of the Helpers class and the arguments it takes, first is wrapper and second is expect package
```bash
Expand All @@ -50,32 +50,32 @@ $ b.see(text, selector)
```JS
it('it shows the text in h2 tag ', () => {
b.see('Where am i ?', 'h2');
b.see('Where am i ?', 'h2');

//Or anywhere you can find this text
b.see('Where am i?');
//Or anywhere you can find this text
b.see('Where am i?');

});
});
```
```bash
```bash
$ b.doNotSee(text)
```
```JS
it('it does not show the text node when visibility is hidden', () => {
b.doNotSee('Header');
})
```
b.doNotSee('Header');
})
```
```bash
$ b.type(text, selector)
```
```JS
it('it does the typing thing ', () => {
b.type('Vue test helpers', 'input[name=title]');
});
b.type('Vue test helpers', 'input[name=title]');
});
```
```bash
Expand All @@ -84,8 +84,8 @@ $ b.click(selector)
```JS
it('it does the click thing ', () => {
b.click('#edit');
});
b.click('#edit');
});
```
```bash
Expand All @@ -94,10 +94,10 @@ $ b.inputValueIs(text, selector)
```JS
it('does the input value has this text', () => {
b.type('Vue test helpers', 'input[name=title]');
b.type('Vue test helpers', 'input[name=title]');

b.inputValueIs('Vue test helpers', 'input[name=title]');
});
b.inputValueIs('Vue test helpers', 'input[name=title]');
});
```
Expand All @@ -107,10 +107,10 @@ $ b.inputValueIs(text, selector)
```JS
it('does the input value is not this text', () => {
b.type('Vue test helpers', 'input[name=title]');
b.inputValueIsNot('Tdd in Vue', 'input[name=title]');
});
b.type('Vue test helpers', 'input[name=title]');

b.inputValueIsNot('Tdd in Vue', 'input[name=title]');
});
```
Expand All @@ -120,8 +120,8 @@ $ b.domHas(selector)
```JS
it('the wrapper or DOM has this' , () => {
b.domHas('h2')
});
b.domHas('h2')
});
```
```bash
Expand All @@ -130,8 +130,8 @@ $ b.domHasNot('selector')
```JS
it('the wrapper or DOM does not have this' , () => {
b.domHasNot('h2')
});
b.domHasNot('h2')
});
```
```bash
Expand All @@ -141,7 +141,7 @@ $ b.hidden('selector')
```JS
it('it checks if the list is visible', () => {
b.hidden('ul');
})
})
```
```bash
Expand All @@ -166,9 +166,9 @@ import Helpers from 'mwangaben-vthelpers';

describe('MockingRequest', () => {
let wrapper, b;

beforeEach(() => {
moxios.install();
moxios.install();

wrapper = mount(MockingRequest, {
propsData: {
Expand Down Expand Up @@ -196,7 +196,7 @@ describe('MockingRequest', () => {
b.domHasNot('textearea[name=body]');

b.click('.edit');

b.inputValueIs('The title', 'input[name=title]');
b.inputValueIs('The body', 'textarea[name=body]');

Expand All @@ -208,7 +208,7 @@ describe('MockingRequest', () => {
});

it('it updates the question when the update is clicked', (done) => {

b.click('.edit');

b.see('Update');
Expand All @@ -220,7 +220,7 @@ describe('MockingRequest', () => {
b.inputValueIs('Changed title', 'input[name=title]');

moxios.stubRequest("/questions", {
status : 200,
status : 200,
response : {
title : 'The title',
body : 'The body'
Expand All @@ -245,7 +245,7 @@ describe('MockingRequest', () => {
b.click('.cancel');

b.see('The title');
});
});
});
```
Expand Down

0 comments on commit 7f47877

Please sign in to comment.