pinafore/tests/spec/037-pin-timelines.js
Nolan Lawson 0022286b46
fix: first stab at i18n, extract English strings, add French (#1904)
* first attempt

* progress

* working

* working

* test timeago

* rm

* get timeago working

* reduce size

* fix whitespace

* more intl stuff

* more effort

* more work

* more progress

* more work

* more intl

* set lang=LOCALE

* flatten

* more work

* add ltr/rtl

* more work

* add comments

* yet more work

* still more work

* more work

* fix tests

* more test and string fixes

* fix test

* fix test

* fix test

* fix some more strings, add test

* fix snackbar

* fix }

* fix typo

* fix english

* measure perf

* start on french

* more work on french

* more french

* more french

* finish french

* fix some missing translations

* update readme

* fix test
2020-11-29 14:13:27 -08:00

39 lines
1.4 KiB
JavaScript

import {
communityNavButton, getUrl, goBack, reload
} from '../utils'
import { loginAsFoobar } from '../roles'
import { Selector as $ } from 'testcafe'
fixture`037-pin-timelines.js`
.page`http://localhost:4002`
test('Can pin a timeline', async t => {
await loginAsFoobar(t)
const pinLocal = $('button[aria-label="Pin Local timeline"]')
const pinFederated = $('button[aria-label="Pin Federated timeline"]')
const pinnedNav = $('.main-nav-li:nth-child(3)')
const pinnedNavLink = $('.main-nav-li:nth-child(3) a')
await t
.click(communityNavButton)
.expect(getUrl()).contains('/community')
.expect(pinLocal.getAttribute('aria-checked')).eql('true')
.expect(pinFederated.getAttribute('aria-checked')).eql('false')
.expect(pinnedNavLink.getAttribute('aria-label')).eql('Local')
.click(pinFederated)
.expect(pinLocal.getAttribute('aria-checked')).eql('false')
.expect(pinFederated.getAttribute('aria-checked')).eql('true')
.expect(pinnedNavLink.getAttribute('aria-label')).eql('Federated')
.click(pinnedNav)
.expect(getUrl()).contains('/federated')
await goBack()
await t
.expect(getUrl()).contains('/community')
await reload()
await t
.expect(getUrl()).contains('/community')
.expect(pinLocal.getAttribute('aria-checked')).eql('false')
.expect(pinFederated.getAttribute('aria-checked')).eql('true')
})