FEATURE: improve blank page syndrome (#168)

FEATURE: improve blank page syndrome (#168)

diff --git a/assets/javascripts/discourse/routes/user-activity-solved.js.es6 b/assets/javascripts/discourse/routes/user-activity-solved.js.es6
index c490daa..da0960f 100644
--- a/assets/javascripts/discourse/routes/user-activity-solved.js.es6
+++ b/assets/javascripts/discourse/routes/user-activity-solved.js.es6
@@ -1,6 +1,14 @@
 import UserActivityStreamRoute from "discourse/routes/user-activity-stream";
+import I18n from "I18n";
 
 export default UserActivityStreamRoute.extend({
   userActionType: 15,
   noContentHelpKey: "solved.no_solutions",
+
+  emptyState() {
+    return {
+      title: I18n.t("solved.no_solved_topics_title"),
+      body: I18n.t("solved.no_solved_topics_body"),
+    };
+  },
 });
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 7cffd18..9dd018e 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -24,6 +24,8 @@ en:
         all: "all"
         solved: "solved"
         unsolved: "unsolved"
+      no_solved_topics_title: "You haven’t solved any topics yet"
+      no_solved_topics_body: "When you provide a helpful reply to a topic, your reply might be selected as the solution by the topic owner or staff."
 
     topic_statuses:
       solved:
diff --git a/test/javascripts/acceptance/user-activity-solved-test.js.es6 b/test/javascripts/acceptance/user-activity-solved-test.js.es6
new file mode 100644
index 0000000..b321c2b
--- /dev/null
+++ b/test/javascripts/acceptance/user-activity-solved-test.js.es6
@@ -0,0 +1,28 @@
+import { acceptance, exists } from "discourse/tests/helpers/qunit-helpers";
+import { test } from "qunit";
+import { visit } from "@ember/test-helpers";
+
+acceptance(
+  "Discourse Solved Plugin | activity/solved | empty state",
+  function (needs) {
+    needs.user();
+
+    needs.pretender((server, helper) => {
+      const emptyResponse = { user_actions: [] };
+
+      server.get("/user_actions.json", () => {
+        return helper.response(emptyResponse);
+      });
+    });
+
+    test("When looking at own activity it renders the empty state panel", async function (assert) {
+      await visit("/u/eviltrout/activity/solved");
+      assert.ok(exists("div.empty-state"));
+    });
+
+    test("When looking at another user's activity it renders the 'No activity' message", async function (assert) {
+      await visit("/u/charlie/activity/solved");
+      assert.ok(exists("div.alert-info"));
+    });
+  }
+);

GitHub sha: 473c53001852a2a2fb2a5ac7bc6cf8e978914fc4