fix favorites/boosts reversed aria labels (#153)

Fixes #146
pull/155/head
Nolan Lawson 2018-04-17 18:38:27 -07:00 zatwierdzone przez GitHub
rodzic 1d61a737da
commit 980fec15ec
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 8 dodań i 3 usunięć

Wyświetl plik

@ -8,7 +8,7 @@
</ExternalLink>
<a class="status-favs-reblogs"
href="/statuses/{{originalStatusId}}/reblogs"
aria-label="{{favoritesLabel}}">
aria-label="{{reblogsLabel}}">
<svg class="status-favs-reblogs-svg">
<use xlink:href="#fa-retweet"/>
</svg>
@ -16,7 +16,7 @@
</a>
<a class="status-favs-reblogs"
href="/statuses/{{originalStatusId}}/favorites"
aria-label="{{reblogsLabel}}">
aria-label="{{favoritesLabel}}">
<svg class="status-favs-reblogs-svg">
<use xlink:href="#fa-star" />
</svg>

Wyświetl plik

@ -1,5 +1,8 @@
import { Selector as $ } from 'testcafe'
import { getFavoritesCount, getNthStatus, getReblogsCount, getUrl } from '../utils'
import {
favoritesCountElement, getFavoritesCount, getNthStatus, getReblogsCount, getUrl,
reblogsCountElement
} from '../utils'
import { foobarRole } from '../roles'
fixture`011-reblog-favorites-count.js`
@ -10,6 +13,7 @@ test('shows favorites', async t => {
.click(getNthStatus(0))
.expect(getUrl()).contains('/statuses/')
.expect(getFavoritesCount()).eql(2)
.expect(favoritesCountElement.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()).match(/\/statuses\/[^/]+\/favorites/)
@ -24,6 +28,7 @@ test('shows boosts', async t => {
.click(getNthStatus(0))
.expect(getUrl()).contains('/statuses/')
.expect(getReblogsCount()).eql(1)
.expect(reblogsCountElement.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()).match(/\/statuses\/[^/]+\/reblogs/)