Skip to content

Commit

Permalink
fix: typing error with props and attributes (#433)
Browse files Browse the repository at this point in the history
* test: add attributes() and props() to type test

* fix: type props and attributes in BaseWrapper #432
  • Loading branch information
vwxyutarooo authored and eddyerburgh committed Feb 16, 2018
1 parent 510bb2f commit cf55756
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ interface BaseWrapper {
exists (): boolean
visible (): boolean

attributes(): { [name: string]: string } | void
attributes(): { [name: string]: string }
classes(): Array<string> | void
props(): { [name: string]: any } | void
props(): { [name: string]: any }

hasAttribute (attribute: string, value: string): boolean
hasClass (className: string): boolean
Expand Down
2 changes: 2 additions & 0 deletions types/test/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ bool = wrapper.contains(ClassComponent)
bool = wrapper.exists()

bool = wrapper.hasAttribute('foo', 'bar')
bool = wrapper.attributes().foo === 'bar'
bool = wrapper.hasClass('foo-class')
bool = wrapper.hasProp('checked', true)
bool = wrapper.props().checked
bool = wrapper.hasStyle('color', 'red')

bool = wrapper.is(normalOptions)
Expand Down

0 comments on commit cf55756

Please sign in to comment.