Skip to content

Commit

Permalink
Issue #2121. Fix search auth tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
miketaylr committed Feb 17, 2018
1 parent dbf3072 commit 7d636a2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
32 changes: 16 additions & 16 deletions tests/functional/search-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,29 @@ registerSuite("Search (auth)", {
return FunctionalHelpers.openPage(
this,
url("/issues"),
".wc-SearchForm-item"
".js-SearchForm-button"
)
.findDisplayedByCssSelector(".wc-SearchForm-item")
.findDisplayedByCssSelector(".js-SearchForm-button")
.click()
.type("taco")
.end()
.findAllByCssSelector("button.wc-Tag--needstriage")
.findAllByCssSelector(".needsdiagnosis.js-Tag")
.click()
.end()
.findByCssSelector(".wc-SearchForm-item")
.findByCssSelector("#js-SearchForm-input")
.getVisibleText()
.then(function(text) {
assert.equal(text, "", "Clicking filter should empty search text");
})
.end()
.findAllByCssSelector("button.wc-Tag--needstriage")
.findAllByCssSelector(".needsdiagnosis.js-Tag")
.click()
.end()
.findByCssSelector(".wc-SearchForm-item")
.findByCssSelector(".js-SearchForm-button")
.click()
.type("taco")
.end()
.findAllByCssSelector("button.wc-Tag--needstriage")
.findAllByCssSelector(".needsdiagnosis.js-Tag")
.getAttribute("class")
.then(function(className) {
assert.notInclude(
Expand All @@ -68,9 +68,9 @@ registerSuite("Search (auth)", {
return FunctionalHelpers.openPage(
this,
url("/issues", params),
".wc-IssueList:nth-of-type(1)"
".js-IssueList:nth-of-type(1)"
)
.findDisplayedByCssSelector(".wc-IssueList:nth-of-type(1) .wc-Link")
.findDisplayedByCssSelector(".js-IssueList:nth-of-type(1) a")
.getVisibleText()
.then(function(text) {
assert.include(
Expand All @@ -95,15 +95,15 @@ registerSuite("Search (auth)", {
return FunctionalHelpers.openPage(
this,
url("/issues"),
".wc-IssueList:nth-of-type(10)"
".js-IssueList:nth-of-type(10)"
)
.findByCssSelector(".js-SearchForm input")
.type("vladvlad")
.end()
.findByCssSelector(".js-SearchForm button")
.click()
.end()
.findDisplayedByCssSelector(".wc-IssueList:only-of-type a")
.findDisplayedByCssSelector(".js-IssueList:only-of-type a")
.getVisibleText()
.then(function(text) {
assert.include(
Expand All @@ -125,7 +125,7 @@ registerSuite("Search (auth)", {
.type("vladvlad")
.type("\uE007")
.end()
.findDisplayedByCssSelector(".wc-IssueList:only-of-type a")
.findDisplayedByCssSelector(".js-IssueList:only-of-type a")
.getVisibleText()
.then(function(text) {
assert.include(
Expand All @@ -151,7 +151,7 @@ registerSuite("Search (auth)", {
.type("vladvlad")
.type("\uE007")
.end()
.findDisplayedByCssSelector(".wc-IssueList:only-of-type a")
.findDisplayedByCssSelector(".js-IssueList:only-of-type a")
.getVisibleText()
.then(function(text) {
assert.include(
Expand All @@ -176,7 +176,7 @@ registerSuite("Search (auth)", {
return FunctionalHelpers.openPage(
this,
url("/issues", searchParam),
".wc-SearchIssue-noResults-title"
".js-no-results"
)
.findByCssSelector("#js-SearchForm-input")
.clearValue()
Expand All @@ -185,7 +185,7 @@ registerSuite("Search (auth)", {
.type("\uE007")
.end()
.findDisplayedByCssSelector(
".wc-IssueList:first-of-type .js-Issue-label"
".js-IssueList:first-of-type .js-Issue-label"
)
.getVisibleText()
.then(function(text) {
Expand All @@ -205,7 +205,7 @@ registerSuite("Search (auth)", {
return FunctionalHelpers.openPage(
this,
url("/issues", searchParam),
".wc-SearchIssue-noResults-title"
".js-no-results"
)
.findByCssSelector("#js-SearchForm-input")
.getProperty("value")
Expand Down
2 changes: 1 addition & 1 deletion webcompat/templates/list-issue/issuelist-issue.jst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<% } else { %>
<article class="grid-row">
<div class="grid-cell issue x3">
<h1 class="headline-1">Sorry, no results were found.</h1>
<h1 class="headline-1 js-no-results">Sorry, no results were found.</h1>
<p class="issue-labels">
Please check your spelling or try a more general search. <br />
You can also search for popular labels like:
Expand Down
12 changes: 6 additions & 6 deletions webcompat/templates/list-issue/issuelist-search.jst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script type="text/template">
<form id="x-search-bar" method="get" action="/issues">
<input id="js-SearchForm-input" class="form-field text-field" name="q" placeholder="Search issues by keyword"/>
<button role="button" class="nav-button nav-link js-SearchForm-button" type="button" title="Search for an item.">
<svg class="icon nav-icon" viewBox="0 0 30 30" role="presentation">
<use href="#svg-search2">Search</use>
</svg>
</button>
<input id="js-SearchForm-input" class="form-field text-field" name="q" placeholder="Search issues by keyword"/>
<button role="button" class="nav-button nav-link js-SearchForm-button" type="button" title="Search for an item.">
<svg class="icon nav-icon" viewBox="0 0 30 30" role="presentation">
<use href="#svg-search2">Search</use>
</svg>
</button>
</form>
</script>

0 comments on commit 7d636a2

Please sign in to comment.