From 7e4dcd7effb103e9f364fc80729f0e2166bee0fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Mestres?= Date: Fri, 20 Oct 2023 15:54:59 +0200 Subject: [PATCH] Try fix snapshot taken when export button is in loading stat --- app/templates/app/generator.hbs | 3 ++- tests/acceptance/visual-test.ts | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/templates/app/generator.hbs b/app/templates/app/generator.hbs index 0c8d91f..947b394 100644 --- a/app/templates/app/generator.hbs +++ b/app/templates/app/generator.hbs @@ -54,9 +54,10 @@ width="full" scale="l" disabled={{this.exportDisabled}} - loading={{this.meshGenerating}} + loading={{true}} icon-start="download" {{on 'click' this.exportSTL}} + data-test-export-stl > {{t 'export_stl'}} diff --git a/tests/acceptance/visual-test.ts b/tests/acceptance/visual-test.ts index c364144..6bdc713 100644 --- a/tests/acceptance/visual-test.ts +++ b/tests/acceptance/visual-test.ts @@ -1,6 +1,6 @@ /* eslint-disable no-await-in-loop */ import { module, test } from 'qunit'; -import { visit } from '@ember/test-helpers'; +import { visit, waitFor } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import testsSettings from './_tests-settings'; import percySnapshot from '@percy/ember'; @@ -22,10 +22,7 @@ module('Acceptance | visual', function (hooks) { // Load test settings through QP await visit(`/en-us/generator?modelSettings=${settingsQP}`); await waitCalciteReady(); - - await new Promise(function (resolve) { - setTimeout(resolve, 250); - }); + await waitFor('[data-test-export-stl]:not([loading])'); await percySnapshot(`visual test #${testIdx + 1}`); assert.true(true); });