[gold] Fix list-page's links to properly include corpus
Bug: skia:10504
Change-Id: I54499d034b7116027cffffbb4c30183c2ecd2169
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/303343
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
diff --git a/golden/modules/list-page-sk/list-page-sk.js b/golden/modules/list-page-sk/list-page-sk.js
index 0433d56..31c2789 100644
--- a/golden/modules/list-page-sk/list-page-sk.js
+++ b/golden/modules/list-page-sk/list-page-sk.js
@@ -66,8 +66,8 @@
const testRow = (row, ele) => {
// TODO(kjlubick) update this to use helpers in search-controls-sk.
const allDigests = 'unt=true&neg=true&pos=true';
- const searchParams = `source_type=${encodeURIComponent(ele._currentCorpus)}`
- + `&query=${encodeURIComponent(`name=${row.name}`)}`
+ const query = encodeURIComponent(`name=${row.name}&source_type=${ele._currentCorpus}`);
+ const searchParams = `query=${query}`
+ `&head=${ele._showAllDigests ? 'false' : 'true'}`
+ `&include=${ele._disregardIgnoreRules ? 'true' : 'false'}`;
diff --git a/golden/modules/list-page-sk/list-page-sk_test.js b/golden/modules/list-page-sk/list-page-sk_test.js
index 3636215..964e42b 100644
--- a/golden/modules/list-page-sk/list-page-sk_test.js
+++ b/golden/modules/list-page-sk/list-page-sk_test.js
@@ -69,7 +69,7 @@
const links = $('a', secondRow);
expect(links).to.have.length(6);
// First link should be to the search results for all digests.
- const paramsForAllDigests = 'source_type=gm&query=name%3Dthis_is_another_test&head=true&include=false&unt=true&neg=true&pos=true';
+ const paramsForAllDigests = 'query=name%3Dthis_is_another_test%26source_type%3Dgm&head=true&include=false&unt=true&neg=true&pos=true';
expect(links[0].href).to.contain(`/search?${paramsForAllDigests}`);
// Second through Fourth links are for just positive, negative, untriaged
expect(links[1].href).to.contain('pos=true&neg=false&unt=false');
@@ -89,7 +89,7 @@
const links = $('a', secondRow);
expect(links).to.have.length(6);
// First link should be to the search results
- const paramsForAllDigests = 'source_type=gm&query=name%3Dthis_is_another_test&head=false&include=true&unt=true&neg=true&pos=true';
+ const paramsForAllDigests = 'query=name%3Dthis_is_another_test%26source_type%3Dgm&head=false&include=true&unt=true&neg=true&pos=true';
expect(links[0].href).to.contain(`/search?${paramsForAllDigests}`);
// Second through Fourth links are for just positive, negative, untriaged
expect(links[1].href).to.contain('pos=true&neg=false&unt=false');