Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various improvement #112

Merged
merged 5 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/templates/app/generator.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
loading={{this.meshGenerating}}
icon-start="download"
{{on 'click' this.exportSTL}}
data-test-export-stl
>
{{t 'export_stl'}}
</calcite-button>
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@
"generate:type_img": "misc/text_type/generate_logo.sh"
},
"devDependencies": {
"@babel/core": "7",
"@babel/eslint-parser": "^7.21.3",
"@babel/plugin-proposal-decorators": "^7.21.0",
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.0.1",
"@ember/test-helpers": "^3.2.0",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
"@glint/template": "1",
"@onehilltech/ember-cli-google-analytics": "^1.5.0",
"@percy/cli": "^1.27.3",
"@percy/ember": "^4.2.0",
Expand Down Expand Up @@ -83,6 +85,7 @@
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-inline-content": "^0.4.1",
"ember-cli-sass": "^10.0.1",
"ember-cli-script": "1.0.0",
"ember-cli-sri": "^2.1.1",
"ember-cli-terser": "^4.0.2",
"ember-cli-typescript": "^4.1.0",
Expand Down
2 changes: 0 additions & 2 deletions tests/acceptance/navigation-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import { module, test } from 'qunit';
import { visit, currentURL, click } from '@ember/test-helpers';
import { setupApplicationTest } from 'ember-qunit';
import mockFontManager from 'text2stl/tests/helpers/mock-font-manager';
import mockGtag from 'text2stl/tests/helpers/mock-gtag';

module('Acceptance | navigation', function (hooks) {
setupApplicationTest(hooks);

hooks.beforeEach(function () {
mockFontManager(this.owner);
mockGtag(this.owner);
});

test('visiting /', async function (assert) {
Expand Down
9 changes: 2 additions & 7 deletions tests/acceptance/visual-test.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
/* 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';
import TextMakerSettings from 'text2stl/models/text-maker-settings';
import mockFontManager from 'text2stl/tests/helpers/mock-font-manager';
import mockGtag from 'text2stl/tests/helpers/mock-gtag';
import waitCalciteReady from 'text2stl/tests/helpers/wait-calcite-ready';

module('Acceptance | visual', function (hooks) {
setupApplicationTest(hooks);

hooks.beforeEach(function () {
mockFontManager(this.owner);
mockGtag(this.owner);
});

for (let testIdx = 0; testIdx < testsSettings.length; testIdx++) {
Expand All @@ -24,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
11 changes: 0 additions & 11 deletions tests/helpers/mock-gtag.ts

This file was deleted.

3 changes: 2 additions & 1 deletion tests/integration/components/settings-form/handle-test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, click } from '@ember/test-helpers';
import { render, click, waitFor } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import config from 'text2stl/config/environment';
const {
Expand Down Expand Up @@ -29,6 +29,7 @@ module('Integration | Component | advanced-settings-form/handle', function (hook
.doesNotExist('it does not render handle settings when handle-type is "none"');

await click('[data-test-handle-type-item] [data-test-value="hole"]');
await waitFor('[data-test-handle-position]', { timeout: 1000 });

assert.dom('[data-test-handle-position]').exists('it show handle-position input');
assert.dom('[data-test-settings-handle-size]').exists('it show handle-size input');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module('Integration | Component | settings-form/select-type', function (hooks) {
await click(
`calcite-segmented-control-item[data-test-type="${ModelType.VerticalTextWithSupport}"]`,
);
await waitUntil(() => model.text === 'some multiline text');
await waitUntil(() => model.text === 'some multiline text', { timeout: 1000 });
assert.strictEqual(model.text, 'some multiline text', 'text was updated');
});
});
3 changes: 0 additions & 3 deletions tests/unit/controllers/app/generator-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import waitUntil from '@ember/test-helpers/wait-until';
import mockTextSettings from 'text2stl/tests/helpers/mock-text-maker-settings';
import { Font } from 'opentype.js';
import { Mesh } from 'three';
import mockGtag from 'text2stl/tests/helpers/mock-gtag';

import type { TextMakerParameters } from 'text2stl/services/text-maker';
import type { Variant } from 'text2stl/services/font-manager';
import type GeneratorController from 'text2stl/controllers/app/generator';
Expand Down Expand Up @@ -79,7 +77,6 @@ module('Unit | Controller | app/generator', function (hooks) {

test('it generate a STL with mesh', async function (assert) {
assert.expect(6);
mockGtag(this.owner);
const controller = this.owner.lookup('controller:app/generator') as GeneratorController;

const model = mockTextSettings({
Expand Down
15 changes: 14 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.2.tgz#6a12ced93455827037bfb5ed8492820d60fc32cc"
integrity sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ==

"@babel/core@^7.1.6", "@babel/core@^7.12.0", "@babel/core@^7.16.10", "@babel/core@^7.16.7", "@babel/core@^7.21.0", "@babel/core@^7.3.4":
"@babel/core@7", "@babel/core@^7.1.6", "@babel/core@^7.12.0", "@babel/core@^7.16.10", "@babel/core@^7.16.7", "@babel/core@^7.21.0", "@babel/core@^7.3.4":
version "7.23.2"
resolved "https://registry.npmjs.org/@babel/core/-/core-7.23.2.tgz#ed10df0d580fff67c5f3ee70fd22e2e4c90a9f94"
integrity sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ==
Expand Down Expand Up @@ -1408,6 +1408,11 @@
dependencies:
babel-plugin-debug-macros "^0.3.4"

"@glint/template@1":
version "1.2.1"
resolved "https://registry.npmjs.org/@glint/template/-/template-1.2.1.tgz#b17b2e490ad1826d45e7bec3b87149ca926600e3"
integrity sha512-rlYy/93fAhYjXmTchWcwCpPFMfrqBYEskzbDYawS2oz4DVwtf4fOITLKB0QddQMI7WUCjgXAiIGZqcNa/R4YeQ==

"@handlebars/parser@~2.0.0":
version "2.0.0"
resolved "https://registry.npmjs.org/@handlebars/parser/-/parser-2.0.0.tgz#5e8b7298f31ff8f7b260e6b7363c7e9ceed7d9c5"
Expand Down Expand Up @@ -5400,6 +5405,14 @@ ember-cli-sass@^10.0.1:
broccoli-sass-source-maps "^4.0.0"
ember-cli-version-checker "^2.1.0"

[email protected]:
version "1.0.0"
resolved "https://registry.npmjs.org/ember-cli-script/-/ember-cli-script-1.0.0.tgz#7868072bf27005685f89775e703b43b0d0762720"
integrity sha512-BPlpNik6YEsiSWCIpYJcEs7iVxavExMrVgkkPeLTUKTZwGf6fu0jjqmsdf7jCUupXzenl19XDWjBy7qXFrXfzQ==
dependencies:
ember-cli-babel "^7.26.10"
ember-cli-htmlbars "^5.7.2"

ember-cli-sri@^2.1.1:
version "2.1.1"
resolved "https://registry.npmjs.org/ember-cli-sri/-/ember-cli-sri-2.1.1.tgz#971620934a4b9183cf7923cc03e178b83aa907fd"
Expand Down
Loading