Skip to content

Commit

Permalink
Change data-dusk attribute to just 'dusk'
Browse files Browse the repository at this point in the history
  • Loading branch information
calebporzio committed Aug 25, 2017
1 parent 1ca716b commit f4870cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ElementResolver.php
Expand Up @@ -368,9 +368,9 @@ public function format($selector)
array_keys($sortedElements), array_values($sortedElements), $originalSelector = $selector
);

// If a '@' element alias hasn't been defined, look for a data-dusk DOM hook.
// If a '@' element alias hasn't been defined, look for a dusk attribute hook.
if (starts_with($selector, '@') && $selector === $originalSelector) {
$selector = '[data-dusk="'.explode('@', $selector)[1].'"]';
$selector = '[dusk="'.explode('@', $selector)[1].'"]';
}

return trim($this->prefix.' '.$selector);
Expand Down
2 changes: 1 addition & 1 deletion tests/ElementResolverTest.php
Expand Up @@ -115,7 +115,7 @@ public function test_format_correctly_formats_selectors()
$this->assertEquals('prefix #first', $resolver->format('@modal'));
$this->assertEquals('prefix #second', $resolver->format('@modal-second'));
$this->assertEquals('prefix #first-third', $resolver->format('@modal-third'));
$this->assertEquals('prefix [data-dusk="missing-element"]', $resolver->format('@missing-element'));
$this->assertEquals('prefix [dusk="missing-element"]', $resolver->format('@missing-element'));
}

public function test_find_by_id_with_colon()
Expand Down

0 comments on commit f4870cf

Please sign in to comment.