diff --git a/ui/app/templates/optimize.hbs b/ui/app/templates/optimize.hbs
index c6f3c6135..a08e92d4a 100644
--- a/ui/app/templates/optimize.hbs
+++ b/ui/app/templates/optimize.hbs
@@ -40,35 +40,44 @@
- {{outlet}}
+ {{#if this.filteredSummaries}}
+ {{outlet}}
-
-
- | Job |
- Recommended At |
- # Allocs |
- CPU |
- Mem |
- Agg. CPU |
- Agg. Mem |
-
-
- {{#if row.model.isProcessed}}
-
- {{else}}
-
- {{/if}}
+
+
+ Job |
+ Recommended At |
+ # Allocs |
+ CPU |
+ Mem |
+ Agg. CPU |
+ Agg. Mem |
+
+
+ {{#if row.model.isProcessed}}
+
+ {{else}}
+
+ {{/if}}
-
-
+
+
+ {{else}}
+
+
No Matches
+
+ No recommendations match your current filter selection.
+
+
+ {{/if}}
{{else}}
No Recommendations
diff --git a/ui/tests/acceptance/optimize-test.js b/ui/tests/acceptance/optimize-test.js
index 68469f7bb..3b5d90334 100644
--- a/ui/tests/acceptance/optimize-test.js
+++ b/ui/tests/acceptance/optimize-test.js
@@ -366,7 +366,7 @@ module('Acceptance | optimize search and facets', function(hooks) {
window.localStorage.nomadTokenSecret = managementToken.secretId;
});
- test('search field narrows summary table results', async function(assert) {
+ test('search field narrows summary table results and displays a no matches message when there are none', async function(assert) {
server.createList('job', 1, {
name: 'oooooo',
createRecommendations: true,
@@ -389,6 +389,12 @@ module('Acceptance | optimize search and facets', function(hooks) {
assert.equal(Optimize.recommendationSummaries.length, 2);
assert.ok(Optimize.recommendationSummaries[0].slug.startsWith('oooooo'));
+
+ await Optimize.search.fillIn('qqq');
+
+ assert.notOk(Optimize.card.isPresent);
+ assert.ok(Optimize.empty.isPresent);
+ assert.equal(Optimize.empty.headline, 'No Matches');
});
test('the optimize page has appropriate faceted search options', async function(assert) {