-
Notifications
You must be signed in to change notification settings - Fork 949
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
actually warn, don't raise on duplicate ids in LiveViewTest (#3603)
- Loading branch information
Showing
4 changed files
with
35 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
defmodule Phoenix.LiveViewTest.DOMWarnTest do | ||
use ExUnit.Case, async: false | ||
|
||
import ExUnit.CaptureIO | ||
|
||
alias Phoenix.LiveViewTest.DOM | ||
|
||
describe "parse" do | ||
test "detects duplicate ids" do | ||
assert capture_io(:stderr, fn -> | ||
DOM.parse(""" | ||
<div id="foo"> | ||
<div id="foo"></div> | ||
</div> | ||
""") | ||
end) =~ "Duplicate id found while testing LiveView" | ||
end | ||
|
||
test "handles declarations (issue #3594)" do | ||
assert DOM.parse(""" | ||
<div id="foo"> | ||
<?xml version="1.0" standalone="yes"?> | ||
</div> | ||
""") | ||
end | ||
end | ||
end |