summaryrefslogtreecommitdiff
path: root/tests/test_domain_js.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-24 16:34:47 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-24 16:34:47 +0900
commit51d500833e391c182f536e83a5d62d5e90ce8ca9 (patch)
treefb854309b759773feb83e7e4bbc91e3ed3cb2b00 /tests/test_domain_js.py
parent375fb52fe402d46d633e321ce8f20c1aa61c49b9 (diff)
parent41ee2d6e6595d0eefb4a2b752fd79a3451382d5a (diff)
downloadsphinx-git-51d500833e391c182f536e83a5d62d5e90ce8ca9.tar.gz
Merge branch '3.x' into 7774_remove_develop.rst
Diffstat (limited to 'tests/test_domain_js.py')
-rw-r--r--tests/test_domain_js.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/test_domain_js.py b/tests/test_domain_js.py
index 189f22e5b..1fb865d4b 100644
--- a/tests/test_domain_js.py
+++ b/tests/test_domain_js.py
@@ -4,7 +4,7 @@
Tests the JavaScript Domain
- :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
+ :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -14,10 +14,8 @@ import pytest
from docutils import nodes
from sphinx import addnodes
-from sphinx.addnodes import (
- desc, desc_annotation, desc_content, desc_name,
- desc_parameter, desc_parameterlist, desc_signature
-)
+from sphinx.addnodes import (desc, desc_annotation, desc_content, desc_name, desc_parameter,
+ desc_parameterlist, desc_signature)
from sphinx.domains.javascript import JavaScriptDomain
from sphinx.testing import restructuredtext
from sphinx.testing.util import assert_node
@@ -218,3 +216,13 @@ def test_js_data(app):
assert_node(doctree[0], addnodes.index,
entries=[("single", "name (global variable or constant)", "name", "", None)])
assert_node(doctree[1], addnodes.desc, domain="js", objtype="data", noindex=False)
+
+
+def test_noindexentry(app):
+ text = (".. js:function:: f()\n"
+ ".. js:function:: g()\n"
+ " :noindexentry:\n")
+ doctree = restructuredtext.parse(app, text)
+ assert_node(doctree, (addnodes.index, desc, addnodes.index, desc))
+ assert_node(doctree[0], addnodes.index, entries=[('single', 'f() (built-in function)', 'f', '', None)])
+ assert_node(doctree[2], addnodes.index, entries=[])