Skip to content

Commit

Permalink
docs(matchers): fix recent matcher descriptions
Browse files Browse the repository at this point in the history
Fix description for `toHaveAttribute` matcher. Add description for `toHaveProperty` matcher.
  • Loading branch information
LayZeeDK authored Oct 3, 2018
1 parent 316baaa commit af185c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/src/matchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const toHaveAttr = comparator((el, { attr, val }) => {
});

/**
* expect(host.query('.zippy')).toHaveAttr({ attr: 'id', val: 'zippy' });
* expect(host.query('.zippy')).toHaveAttribute('id', 'zippy');
*/
export const toHaveAttribute = comparator((el, attr, val) => {
const actual = $(el).attr(attr);
Expand All @@ -140,6 +140,9 @@ export const toHaveProp = comparator((el, { prop, val }) => {
return { pass, message };
});

/**
* expect(host.query('.checkbox')).toHaveProperty('checked', true);
*/
export const toHaveProperty = comparator((el, prop, val) => {
const actual = $(el).prop(prop);
const addendum = val !== undefined ? ` with value '${val}'` : '';
Expand Down

0 comments on commit af185c2

Please sign in to comment.