diff --git a/routes/_components/search/AccountSearchResult.html b/routes/_components/search/AccountSearchResult.html
index 7a802df..e8ec88d 100644
--- a/routes/_components/search/AccountSearchResult.html
+++ b/routes/_components/search/AccountSearchResult.html
@@ -2,7 +2,7 @@
- {{account.display_name}}
+ {{account.display_name || account.acct}}
{{'@' + account.acct}}
diff --git a/routes/_components/status/StatusDetails.html b/routes/_components/status/StatusDetails.html
index 0618bd6..c50ab77 100644
--- a/routes/_components/status/StatusDetails.html
+++ b/routes/_components/status/StatusDetails.html
@@ -2,13 +2,13 @@
-
+
{{numReblogs}}
-
+
@@ -95,7 +95,19 @@
createdAtDate: (status) => status.created_at,
numReblogs: (status) => status.reblogs_count || 0,
numFavs: (status) => status.favourites_count || 0,
- formattedDate: (createdAtDate) => formatter.format(new Date(createdAtDate))
+ formattedDate: (createdAtDate) => formatter.format(new Date(createdAtDate)),
+ reblogsLabel: (numReblogs) => {
+ // TODO: intl
+ return numReblogs === 1
+ ? `Boosted ${numReblogs} time`
+ : `Boosted ${numReblogs} times`
+ },
+ favoritesLabel: (numFavs) => {
+ // TODO: intl
+ return numFavs === 1
+ ? `Favorited ${numFavs} time`
+ : `Favorited ${numFavs} times`
+ }
},
components: {
ExternalLink
diff --git a/tests/spec/10-focus.js b/tests/spec/10-focus.js
index 95ac27a..9b409a1 100644
--- a/tests/spec/10-focus.js
+++ b/tests/spec/10-focus.js
@@ -3,7 +3,7 @@ import {
} from '../utils'
import { foobarRole } from '../roles'
-fixture`09-threads.js`
+fixture`10-focus.js`
.page`http://localhost:4002`
test('modal preserves focus', async t => {
diff --git a/tests/spec/11-reblog-favorites-count.js b/tests/spec/11-reblog-favorites-count.js
new file mode 100644
index 0000000..77a3cbe
--- /dev/null
+++ b/tests/spec/11-reblog-favorites-count.js
@@ -0,0 +1,32 @@
+import { Selector as $ } from 'testcafe'
+import { getNthStatus, getUrl } from '../utils'
+import { foobarRole } from '../roles'
+
+fixture`11-reblog-favorites-count.js`
+ .page`http://localhost:4002`
+
+test('shows favorites', async t => {
+ await t.useRole(foobarRole)
+ .click(getNthStatus(0))
+ .expect(getUrl()).contains('/statuses/99549266679020981')
+ .expect($('.status-favs-reblogs').nth(0).getAttribute('aria-label')).eql('Favorited 2 times')
+ .expect($('.icon-button[aria-label="Favorite"]').getAttribute('aria-pressed')).eql('true')
+ .click($('.status-favs-reblogs').nth(1))
+ .expect(getUrl()).contains('/statuses/99549266679020981/favorites')
+ .expect($('.search-result-account-name').nth(0).innerText).eql('foobar')
+ .expect($('.search-result-account-username').nth(0).innerText).eql('@foobar')
+ .expect($('.search-result-account-name').nth(1).innerText).eql('admin')
+ .expect($('.search-result-account-username').nth(1).innerText).eql('@admin')
+})
+
+test('shows boosts', async t => {
+ await t.useRole(foobarRole)
+ .click(getNthStatus(0))
+ .expect(getUrl()).contains('/statuses/99549266679020981')
+ .expect($('.status-favs-reblogs').nth(1).getAttribute('aria-label')).eql('Boosted 1 time')
+ .expect($('.icon-button[aria-label="Boost"]').getAttribute('aria-pressed')).eql('false')
+ .click($('.status-favs-reblogs').nth(0))
+ .expect(getUrl()).contains('/statuses/99549266679020981/reblogs')
+ .expect($('.search-result-account-name').nth(0).innerText).eql('admin')
+ .expect($('.search-result-account-username').nth(0).innerText).eql('@admin')
+})