Skip to content

Commit

Permalink
Hide subdomains if there aren't any defined
Browse files Browse the repository at this point in the history
This is the case at the moment, because the domain model we've pulled in
from CaDeT doesn't have subdomains. This might change later though so I
don't want to remove the subdomain code completely.
  • Loading branch information
MatMoore committed Jun 10, 2024
1 parent 0dd1be9 commit b907229
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 2 additions & 0 deletions templates/partial/filter.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ <h2 class="govuk-heading-m">Filter</h2>
<label class="govuk-label" for="{{form.domain.id_for_label}}">Top-level domain</label>
{{form.domain}}
</div>
{% if form.subdomain.choices %}
<div class="govuk-form-group js-required">
<label class="govuk-label" for="{{form.subdomain.id_for_label}}">Subdomain</label>
{{form.subdomain}}
</div>
{% endif %}
</fieldset>
</div>
<div class="govuk-form-group">
Expand Down
12 changes: 0 additions & 12 deletions tests/selenium/test_search_scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ def test_clear_single_filter(self):
self.verify_domain_selected(domain)
self.click_clear_selected_filter(domain)
self.verify_unselected_domain()
self.verify_unselected_subdomain()

def test_clear_all_filters(self):
"""
Expand Down Expand Up @@ -271,9 +270,6 @@ def enter_a_query_and_submit(self, query):
def select_domain(self, domain):
self.search_page.select_domain(domain)

def select_subdomain(self, domain):
self.search_page.select_subdomain(domain)

def click_option(self, sortby):
self.search_page.sort_label(sortby).click()

Expand All @@ -295,18 +291,10 @@ def verify_domain_selected(self, domain):
selected_domain = self.search_page.get_selected_domain().text
assert selected_domain == domain

def verify_subdomain_selected(self, domain):
selected_domain = self.search_page.get_selected_subdomain().text
assert selected_domain == domain

def verify_unselected_domain(self):
selected_domain = self.search_page.get_selected_domain().text
assert selected_domain == "All domains"

def verify_unselected_subdomain(self):
selected_domain = self.search_page.get_selected_subdomain().text
assert selected_domain == "All subdomains"

def verify_selected_filters_shown(self, domains):
actual = {i.text for i in self.search_page.selected_filter_tags()}
expected = set(domains)
Expand Down

0 comments on commit b907229

Please sign in to comment.