From a5ca99c2f0ebb12f409ba87d48afebf220bc9745 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Thu, 15 Mar 2018 17:33:52 -0700 Subject: [PATCH] fix some tests --- routes/_components/status/Status.html | 3 ++- tests/utils.js | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/routes/_components/status/Status.html b/routes/_components/status/Status.html index be6e3bfa..0a2978ba 100644 --- a/routes/_components/status/Status.html +++ b/routes/_components/status/Status.html @@ -23,7 +23,8 @@ {{/if}} {{#if originalStatus.media_attachments && originalStatus.media_attachments.length}} - + {{/if}} {{#if isStatusInOwnThread}} diff --git a/tests/utils.js b/tests/utils.js index 452e9101..b674ef42 100644 --- a/tests/utils.js +++ b/tests/utils.js @@ -2,7 +2,7 @@ import { ClientFunction as exec, Selector as $ } from 'testcafe' import * as images from './images' import * as blobUtils from './blobUtils' -const SCROLL_INTERVAL = 2 +const SCROLL_INTERVAL = 1 export const settingsButton = $('nav a[aria-label=Settings]') export const instanceInput = $('#instanceInput') @@ -185,8 +185,13 @@ export async function scrollToBottomOfTimeline (t) { } export async function scrollToStatus (t, n) { - for (let i = 0; i < n; i += 2) { - await t.hover(getNthStatus(n)) + for (let i = 0; i <= n; i += SCROLL_INTERVAL) { + await t.hover(getNthStatus(i)) + .expect($('.loading-footer').exist).notOk() + if (i < n) { + await t.hover(getNthStatus(i).find('.status-toolbar')) + .expect($('.loading-footer').exist).notOk() + } } await t.hover(getNthStatus(n)) }