Skip to content

Commit

Permalink
Isolate bug #37 with failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Aug 9, 2019
1 parent 6055467 commit cd71106
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/unit/Helper/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class Helper {
<input name="email" type="email" placeholder="e.g. j.smith@email.com" required />
</label>
<label>
<span>Your message</span>
<span data-ga-client="(Test) Message, this has a comma">Your message</span>
<textarea></textarea>
</label>
<label>
Expand Down
15 changes: 15 additions & 0 deletions test/unit/TranslatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,19 @@ public function testCommaSeparatedSelectors() {
$translator
);
}

public function testCommaInAttributeDoesNotSeparate() {
$document = new HTMLDocument(Helper::HTML_COMPLEX);
$emailTranslator = new Translator("[name=email]");
$messageTranslator = new Translator("[data-ga-client='(Test) Message, this has a comma']");

$emailItems = $document->xPath($emailTranslator);
$messageItems = $document->xPath($messageTranslator);

self::assertCount(1, $emailItems);
self::assertCount(1, $messageItems);

self::assertEquals("INPUT", strtoupper($emailItems[0]->tagName));
self::assertEquals("SPAN", strtoupper($messageItems[0]->tagName));
}
}

0 comments on commit cd71106

Please sign in to comment.