Skip to content

Commit

Permalink
Try fix snapshot taken when export button is in loading stat
Browse files Browse the repository at this point in the history
  • Loading branch information
romgere committed Oct 20, 2023
1 parent 4ff3f95 commit 7e4dcd7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 2 additions & 1 deletion app/templates/app/generator.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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'}}
</calcite-button>
Expand Down
7 changes: 2 additions & 5 deletions tests/acceptance/visual-test.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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);
});
Expand Down

0 comments on commit 7e4dcd7

Please sign in to comment.