Skip to content

Commit

Permalink
Allow overriding of selectors in the constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
LewisW committed Sep 14, 2016
1 parent 3754e58 commit d0e8655
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/list.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class List extends Widget
constructor: (selector, itemSelector, driver, widget) ->
super selector, driver
@Widget = widget ? Widget
@itemSelector ?= itemSelector
@itemSelector = itemSelector if itemSelector?
@_nestedItemsSelector = "#{@selector} #{@itemSelector}"
@widgets = @_wrapAsWidgets(@driver.elements(@_nestedItemsSelector).value)

Expand Down
2 changes: 1 addition & 1 deletion source/widget.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Widget extends Base
selector: null

constructor: (selector, @driver=driver.api) ->
@selector ?= selector
@selector = selector if selector?
if not typeof @selector is 'string'
throw new Error "Invalid selector given: #{@selector}"

Expand Down

0 comments on commit d0e8655

Please sign in to comment.