-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(test_parse.py): Split render tests into their own file
- Loading branch information
Showing
2 changed files
with
42 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from adr_viewer import render_html | ||
|
||
|
||
def test_should_render_html_with_project_title(): | ||
html = render_html({ | ||
'project_title': 'my-project' | ||
}) | ||
|
||
assert '<title>ADR Viewer - my-project</title>' in html | ||
|
||
|
||
def test_should_render_html_with_record_status(): | ||
html = render_html({ | ||
'records': [{ | ||
'status': 'accepted', | ||
}] | ||
}) | ||
|
||
assert '<div class="panel-heading adr-accepted">' in html | ||
|
||
|
||
def test_should_render_html_with_record_body(): | ||
html = render_html({ | ||
'records': [{ | ||
'body': '<h1>This is my ADR</h1>', | ||
}] | ||
}) | ||
|
||
assert '<div class="panel-body"><h1>This is my ADR</h1></div>' in html | ||
|
||
|
||
def test_should_render_html_with_collapsible_index(): | ||
html = render_html({ | ||
'records': [{ | ||
'title': 'Record 123', | ||
'index': 123 | ||
}] | ||
}) | ||
|
||
assert '<a data-toggle="collapse" href="#collapse123">Record 123</a>' in html |