test: Add test case to check breadcrumbs

This commit is contained in:
Suraj Shetty 2021-05-27 12:57:55 +05:30
parent d13eac6f50
commit 9ec451b28e
6 changed files with 16 additions and 6 deletions

View file

@ -3,11 +3,6 @@
{% for item in children_map[route] %}
<li>
<a href="{{ url_prefix }}{{ item.route }}">{{ item.title }}</a>
{#
{% if children_map[item.route] %}
{{ make_item_list(item.route, children_map) }}
{% endif %}
#}
</li>
{% endfor %}
</ol>

View file

@ -8,6 +8,7 @@
{%- endblock -%}
</head>
<body>
{% include "templates/includes/breadcrumbs.html" %}
<h1>This is for testing</h1>
{% block content %}{% endblock %}
{%- block script %}

View file

@ -113,7 +113,13 @@ class TestWebPage(unittest.TestCase):
frappe.as_unicode(content))
def test_breadcrumbs(self):
pass
content = get_response_content('/_test/_test_folder/_test_page')
self.assertIn('<span itemprop="name">Test TOC</span>', content)
self.assertIn('<span itemprop="name"> Test Page</span>', content)
content = get_response_content('/_test/_test_folder/index')
self.assertIn('<span itemprop="name"> Test</span>', content)
self.assertIn('<span itemprop="name">Test TOC</span>', content)
def test_downloadable_file(self):
pass

View file

@ -1,2 +1,3 @@
def get_context(context):
context.base_template_path = 'frappe/templates/test/_test_base.html'
context.add_breadcrumbs = 1

View file

@ -1,3 +1,9 @@
---
title: Test TOC
add_breadcrumbs: 1
show_sidebar: 1
---
# Index
{index}

View file

@ -0,0 +1 @@
{index}