Introduce #search element as required in failure template
Change-Id: Id3d8a7b53add897680b4f35f3df4794151e47165
diff --git a/dev/scss/main/resultinfo.scss b/dev/scss/main/resultinfo.scss
index 77fbfd4..d767d19 100644
--- a/dev/scss/main/resultinfo.scss
+++ b/dev/scss/main/resultinfo.scss
@@ -57,7 +57,16 @@
}
}
-
+/*
+ * TODO:
+ * This rule should not be dependent on
+ * whether something is found or not,
+ * but whether #search contains a result,
+ * e.g. when a result view is open in the
+ * result panel. This should probably be
+ * indicated by a class on the button group
+ * rather than a class on the resultinfo.
+ */
#resultinfo.found {
position: relative;
// z-index: 20;
@@ -74,14 +83,6 @@
border-bottom-right-radius: 0;
}
}
-
- /*
- div.result.left {
- position: absolute;
- left: 0;
- bottom: 0;
- }
- */
}
diff --git a/t/query.t b/t/query.t
index e7f4fc6..b1ae3bb 100644
--- a/t/query.t
+++ b/t/query.t
@@ -24,8 +24,6 @@
# Configure fake backend
$fake_backend->pattern->defaults->{app}->log($t->app->log);
-if (0) {
-
# Query passed
$t->get_ok('/?q=baum')
->status_is(200)
@@ -78,6 +76,7 @@
$t->get_ok('/?q=[orth=das')
->status_is(400)
->text_is('div.notify-error:nth-of-type(1)', '302: Parantheses/brackets unbalanced.')
+ ->element_exists('#search')
->text_like('div.notify-error:nth-of-type(2)', qr!302: Could not parse query .+? \[orth=das.+?!)
;
@@ -167,6 +166,7 @@
->status_is(200)
->text_is('#error','')
->text_is('title', 'KorAP: Find »der« with Poliqarp')
+ ->element_exists('#search')
# Total results
->text_is('#total-results', '14,581')
@@ -187,6 +187,7 @@
$t->get_ok('/?q=fantastisch&ql=Fabelsprache')
->status_is(400)
->text_is('noscript div.notify-error', 'Parameter "ql" invalid')
+ ->element_exists('#search')
->element_count_is('noscript div.notify-error', 1)
;
$t->get_ok('/?q=fantastisch&cutoff=no')
@@ -200,8 +201,6 @@
->element_count_is('noscript div.notify-error', 3)
;
-};
-
# Query too long
my $long_query = 'b' x 2000;
$t->get_ok('/?q=' . $long_query)
diff --git a/templates/failure.html.ep b/templates/failure.html.ep
index 509333a..5cb98a1 100644
--- a/templates/failure.html.ep
+++ b/templates/failure.html.ep
@@ -4,6 +4,8 @@
%= include 'query'
+<div id="search"></div>
+
<p class="no-results"><%= loc('notIssued') %></p>
% if (stash('err_msg')) {
<p class="no-results"><%= loc(stash('err_msg'),stash('err_msg')) %></p>