2018-02-20 03:24:22 +01:00
|
|
|
import { Selector as $ } from 'testcafe'
|
2018-02-21 06:08:26 +01:00
|
|
|
import { getNthStatus } from '../utils'
|
2018-05-26 22:51:41 +02:00
|
|
|
import { loginAsFoobar } from '../roles'
|
2018-02-20 03:24:22 +01:00
|
|
|
|
2018-03-07 06:32:51 +01:00
|
|
|
fixture`006-tabindex.js`
|
2018-02-20 03:25:59 +01:00
|
|
|
.page`http://localhost:4002`
|
2018-02-20 03:24:22 +01:00
|
|
|
|
|
|
|
test('shows correct tabindex in home timeline', async t => {
|
2018-05-26 22:51:41 +02:00
|
|
|
await loginAsFoobar(t)
|
|
|
|
await t
|
2018-02-21 06:08:26 +01:00
|
|
|
.expect(getNthStatus(1).getAttribute('tabindex')).eql('0')
|
|
|
|
.expect(getNthStatus(2).getAttribute('tabindex')).eql('0')
|
|
|
|
.expect(getNthStatus(3).getAttribute('tabindex')).eql('0')
|
2019-02-28 17:56:25 +01:00
|
|
|
.expect(getNthStatus(4).getAttribute('tabindex')).eql('0')
|
2018-02-20 03:24:22 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
test('shows correct tabindex in notifications', async t => {
|
2018-05-26 22:51:41 +02:00
|
|
|
await loginAsFoobar(t)
|
|
|
|
await t
|
2018-02-20 03:24:22 +01:00
|
|
|
.navigateTo('/notifications')
|
2018-02-21 06:08:26 +01:00
|
|
|
.expect(getNthStatus(1).getAttribute('tabindex')).eql('0')
|
|
|
|
.expect(getNthStatus(2).getAttribute('tabindex')).eql('0')
|
|
|
|
.expect(getNthStatus(3).getAttribute('tabindex')).eql('0')
|
2019-02-28 17:56:25 +01:00
|
|
|
.hover(getNthStatus(3))
|
2018-02-21 06:08:26 +01:00
|
|
|
.expect(getNthStatus(4).getAttribute('tabindex')).eql('0')
|
|
|
|
.expect(getNthStatus(5).getAttribute('tabindex')).eql('0')
|
2019-02-28 17:56:25 +01:00
|
|
|
.hover(getNthStatus(5))
|
2018-02-21 06:08:26 +01:00
|
|
|
.expect(getNthStatus(6).getAttribute('tabindex')).eql('0')
|
|
|
|
.expect(getNthStatus(7).getAttribute('tabindex')).eql('0')
|
2019-02-28 17:56:25 +01:00
|
|
|
.hover(getNthStatus(7))
|
|
|
|
.expect(getNthStatus(8).getAttribute('tabindex')).eql('0')
|
|
|
|
.expect(getNthStatus(8).getAttribute('aria-setsize')).eql('8')
|
2018-02-20 03:24:22 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
test('shows correct tabindex in pinned statuses', async t => {
|
2018-05-26 22:51:41 +02:00
|
|
|
await loginAsFoobar(t)
|
|
|
|
await t
|
2018-02-20 03:24:22 +01:00
|
|
|
.navigateTo('/pinned')
|
|
|
|
.expect($('.status-article').getAttribute('tabindex')).eql('0')
|
2019-02-28 17:56:25 +01:00
|
|
|
.expect($('.status-article').getAttribute('aria-posinset')).eql('1')
|
2018-02-20 03:24:22 +01:00
|
|
|
.expect($('.status-article').getAttribute('aria-setsize')).eql('1')
|
|
|
|
})
|