fix lint issues
This commit is contained in:
parent
391455bee4
commit
5c2dc4c421
|
@ -41,3 +41,7 @@ Lint:
|
||||||
Run integration tests:
|
Run integration tests:
|
||||||
|
|
||||||
npm test
|
npm test
|
||||||
|
|
||||||
|
Automatically fix most linting issues:
|
||||||
|
|
||||||
|
npx standard --fix
|
|
@ -1,7 +1,7 @@
|
||||||
import { Selector as $, Role } from 'testcafe'
|
import { Selector as $, Role } from 'testcafe'
|
||||||
import { addInstanceButton, getUrl, instanceInput } from './utils'
|
import { addInstanceButton, getUrl, instanceInput } from './utils'
|
||||||
|
|
||||||
function login(t, username, password) {
|
function login (t, username, password) {
|
||||||
return t.typeText(instanceInput, 'localhost:3000')
|
return t.typeText(instanceInput, 'localhost:3000')
|
||||||
.click(addInstanceButton)
|
.click(addInstanceButton)
|
||||||
.expect(getUrl()).eql('http://localhost:3000/auth/sign_in')
|
.expect(getUrl()).eql('http://localhost:3000/auth/sign_in')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { Selector as $ } from 'testcafe'
|
import { Selector as $ } from 'testcafe'
|
||||||
import { getUrl, settingsButton } from '../utils'
|
import { getUrl, settingsButton } from '../utils'
|
||||||
|
|
||||||
fixture `01-basic-spec.js`
|
fixture`01-basic-spec.js`
|
||||||
.page `http://localhost:4002`
|
.page`http://localhost:4002`
|
||||||
|
|
||||||
test('has the correct <h1>', async t => {
|
test('has the correct <h1>', async t => {
|
||||||
await t
|
await t
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { Selector as $ } from 'testcafe'
|
import { Selector as $ } from 'testcafe'
|
||||||
import { addInstanceButton, getUrl, instanceInput, login, settingsButton } from '../utils'
|
import { addInstanceButton, getUrl, instanceInput, settingsButton } from '../utils'
|
||||||
|
|
||||||
fixture `02-login-spec.js`
|
fixture`02-login-spec.js`
|
||||||
.page `http://localhost:4002`
|
.page`http://localhost:4002`
|
||||||
|
|
||||||
const formError = $('.form-error')
|
const formError = $('.form-error')
|
||||||
|
|
||||||
function manualLogin(t, username, password) {
|
function manualLogin (t, username, password) {
|
||||||
return t.click($('a').withText('log in to an instance'))
|
return t.click($('a').withText('log in to an instance'))
|
||||||
.expect(getUrl()).contains('/settings/instances/add')
|
.expect(getUrl()).contains('/settings/instances/add')
|
||||||
.typeText(instanceInput, 'localhost:3000')
|
.typeText(instanceInput, 'localhost:3000')
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { Selector as $ } from 'testcafe'
|
import { Selector as $ } from 'testcafe'
|
||||||
import { getUrl, login, validateTimeline } from '../utils'
|
import { getUrl, validateTimeline } from '../utils'
|
||||||
import { homeTimeline, notifications, localTimeline, favorites } from '../fixtures'
|
import { homeTimeline, notifications, localTimeline, favorites } from '../fixtures'
|
||||||
import { foobarRole } from '../roles'
|
import { foobarRole } from '../roles'
|
||||||
|
|
||||||
fixture `03-basic-timeline-spec.js`
|
fixture`03-basic-timeline-spec.js`
|
||||||
.page `http://localhost:4002`
|
.page`http://localhost:4002`
|
||||||
|
|
||||||
const firstArticle = $('.virtual-list-item[aria-hidden=false] .status-article')
|
const firstArticle = $('.virtual-list-item[aria-hidden=false] .status-article')
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { Selector as $ } from 'testcafe'
|
import { Selector as $ } from 'testcafe'
|
||||||
import { getUrl, login } from '../utils'
|
import { getUrl } from '../utils'
|
||||||
import { foobarRole } from '../roles'
|
import { foobarRole } from '../roles'
|
||||||
|
|
||||||
fixture `04-pinned-statuses.js`
|
fixture`04-pinned-statuses.js`
|
||||||
.page `http://localhost:4002`
|
.page`http://localhost:4002`
|
||||||
|
|
||||||
test("shows a user's pinned statuses", async t => {
|
test("shows a user's pinned statuses", async t => {
|
||||||
await t.useRole(foobarRole)
|
await t.useRole(foobarRole)
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { getNthVirtualArticle } from '../utils'
|
import { getNthVirtualArticle } from '../utils'
|
||||||
import { foobarRole } from '../roles'
|
import { foobarRole } from '../roles'
|
||||||
|
|
||||||
fixture `05-status-types.js`
|
fixture`05-status-types.js`
|
||||||
.page `http://localhost:4002`
|
.page`http://localhost:4002`
|
||||||
|
|
||||||
test('shows direct vs followers-only vs regular', async t => {
|
test('shows direct vs followers-only vs regular', async t => {
|
||||||
await t.useRole(foobarRole)
|
await t.useRole(foobarRole)
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { Selector as $ } from 'testcafe'
|
||||||
import { getNthVirtualArticle } from '../utils'
|
import { getNthVirtualArticle } from '../utils'
|
||||||
import { foobarRole } from '../roles'
|
import { foobarRole } from '../roles'
|
||||||
|
|
||||||
fixture `06-tabindex.js`
|
fixture`06-tabindex.js`
|
||||||
.page `http://localhost:4002`
|
.page`http://localhost:4002`
|
||||||
|
|
||||||
test('shows correct tabindex in home timeline', async t => {
|
test('shows correct tabindex in home timeline', async t => {
|
||||||
await t.useRole(foobarRole)
|
await t.useRole(foobarRole)
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { Selector as $ } from 'testcafe'
|
||||||
import { getUrl } from '../utils'
|
import { getUrl } from '../utils'
|
||||||
import { foobarRole } from '../roles'
|
import { foobarRole } from '../roles'
|
||||||
|
|
||||||
fixture `07-account-profile.js`
|
fixture`07-account-profile.js`
|
||||||
.page `http://localhost:4002`
|
.page`http://localhost:4002`
|
||||||
|
|
||||||
test('shows account profile', async t => {
|
test('shows account profile', async t => {
|
||||||
await t.useRole(foobarRole)
|
await t.useRole(foobarRole)
|
||||||
|
|
|
@ -10,7 +10,7 @@ export function getNthVirtualArticle (n) {
|
||||||
return $(`.virtual-list-item[aria-hidden="false"] article[aria-posinset="${n}"]`)
|
return $(`.virtual-list-item[aria-hidden="false"] article[aria-posinset="${n}"]`)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function validateTimeline(t, timeline) {
|
export async function validateTimeline (t, timeline) {
|
||||||
for (let i = 0; i < timeline.length; i++) {
|
for (let i = 0; i < timeline.length; i++) {
|
||||||
let status = timeline[i]
|
let status = timeline[i]
|
||||||
if (status.content) {
|
if (status.content) {
|
||||||
|
|
Loading…
Reference in a new issue