diff --git a/.github/workflows/frontend-admin.yml b/.github/workflows/frontend-admin.yml index 9060dfb79..874076a21 100644 --- a/.github/workflows/frontend-admin.yml +++ b/.github/workflows/frontend-admin.yml @@ -6,6 +6,9 @@ on: - 'frontend-angular/**' - '.github/workflows/frontend-admin.yml' +env: + NODE_OPTIONS: --openssl-legacy-provider + jobs: lint: name: lint diff --git a/.github/workflows/frontend-app-test.yml b/.github/workflows/frontend-app-test.yml index 570893aca..a5b091f87 100644 --- a/.github/workflows/frontend-app-test.yml +++ b/.github/workflows/frontend-app-test.yml @@ -8,8 +8,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: 22 - uses: rwjblue/setup-volta@v1 - - uses: H1D/actions-ember-testing@8ca8da615c2db5889b7fbd3834e4093706754435 - name: Install dependencies working-directory: ./frontend run: yarn install @@ -31,8 +33,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: 22 - uses: rwjblue/setup-volta@v1 - - uses: H1D/actions-ember-testing@8ca8da615c2db5889b7fbd3834e4093706754435 - name: Install dependencies working-directory: ./frontend run: yarn install diff --git a/Dockerfile_frontend b/Dockerfile_frontend index 7304ee2f5..f5ec86dcc 100644 --- a/Dockerfile_frontend +++ b/Dockerfile_frontend @@ -1,4 +1,4 @@ -FROM node:12 AS build-frontend +FROM node:22 AS build-frontend ARG FIREBASE_PROJECT_ID ENV FIREBASE_PROJECT_ID ${FIREBASE_PROJECT_ID:-} ARG FIREBASE_AUTH_DOMAIN @@ -10,9 +10,10 @@ WORKDIR /src RUN yarn RUN node node_modules/ember-cli/bin/ember deploy production -FROM node:12 AS build-frontend-angular +FROM node:22 AS build-frontend-angular COPY frontend-angular/ /src/ WORKDIR /src +ENV NODE_OPTIONS=--openssl-legacy-provider RUN npm ci RUN npm run build diff --git a/Dockerfile_frontend_with_tls b/Dockerfile_frontend_with_tls index 433cd13e7..470008e7e 100644 --- a/Dockerfile_frontend_with_tls +++ b/Dockerfile_frontend_with_tls @@ -1,12 +1,13 @@ -FROM node:12 AS build-frontend +FROM node:22 AS build-frontend COPY frontend/ /src/ WORKDIR /src RUN yarn RUN node node_modules/ember-cli/bin/ember deploy production -FROM node:12 AS build-frontend-angular +FROM node:22 AS build-frontend-angular COPY frontend-angular/ /src/ WORKDIR /src +ENV NODE_OPTIONS=--openssl-legacy-provider RUN npm ci RUN npm run build diff --git a/frontend-angular/custom-webpack-config.ts b/frontend-angular/custom-webpack-config.ts index c4b526bdb..a04ec8cb1 100644 --- a/frontend-angular/custom-webpack-config.ts +++ b/frontend-angular/custom-webpack-config.ts @@ -1,6 +1,10 @@ import { DefinePlugin } from 'webpack'; export default { + output: { + // ... other configurations + hashFunction: 'sha256', + }, plugins: [ new DefinePlugin({ process: { diff --git a/frontend/app/components/exercise-group.hbs b/frontend/app/components/exercise-group.hbs index cca6f7f89..a14df7adb 100644 --- a/frontend/app/components/exercise-group.hbs +++ b/frontend/app/components/exercise-group.hbs @@ -1,8 +1,9 @@ - {{! template-lint-disable no-inline-styles style-concatenation }} @@ -25,4 +26,4 @@ {{@group.name}} - \ No newline at end of file + \ No newline at end of file diff --git a/frontend/app/components/link-to/component.js b/frontend/app/components/link-to/component.js deleted file mode 100644 index 441b140b2..000000000 --- a/frontend/app/components/link-to/component.js +++ /dev/null @@ -1,6 +0,0 @@ -import LinkComponent from '@ember/routing/link-component'; - -// eslint-disable-next-line ember/no-classic-classes -export default LinkComponent.extend({ - attributeBindings: ['active:aria-current', 'disabled'], -}); diff --git a/frontend/app/components/link-to/template.hbs b/frontend/app/components/link-to/template.hbs deleted file mode 100644 index fb5c4b157..000000000 --- a/frontend/app/components/link-to/template.hbs +++ /dev/null @@ -1 +0,0 @@ -{{yield}} \ No newline at end of file diff --git a/frontend/app/components/ui/exercise-button/index.hbs b/frontend/app/components/ui/exercise-button/index.hbs index 4414df33f..5743889b0 100644 --- a/frontend/app/components/ui/exercise-button/index.hbs +++ b/frontend/app/components/ui/exercise-button/index.hbs @@ -1,7 +1,8 @@ - @@ -16,4 +17,4 @@ @isActive={{this.isActive}} /> - \ No newline at end of file + \ No newline at end of file diff --git a/frontend/app/routes/application.ts b/frontend/app/routes/application.js similarity index 65% rename from frontend/app/routes/application.ts rename to frontend/app/routes/application.js index 518b2f621..3b6590f94 100644 --- a/frontend/app/routes/application.ts +++ b/frontend/app/routes/application.js @@ -1,22 +1,25 @@ import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import Ember from 'ember'; -import Session from 'ember-simple-auth/services/session'; -import IntlService from 'ember-intl/services/intl'; -import type Transition from '@ember/routing/-private/transition'; +// import Session from 'ember-simple-auth/services/session'; +// import IntlService from 'ember-intl/services/intl'; +// import type Transition from '@ember/routing/-private/transition'; export default class ApplicationRoute extends Route { - @service('session') session!: Session; - @service('intl') intl!: IntlService; + @service('session') session + // !: Session; + @service('intl') intl; + // !: IntlService; - beforeModel() { + async beforeModel() { + await this.session.setup(); const navigatorLanguage = navigator.languages.filter(el => el.includes('-')).map(el => el.toLowerCase())[0]; const rawLocale = localStorage.getItem('locale') || navigatorLanguage; const locale = rawLocale === 'ru-ru' ? 'ru-ru' : 'en-us'; this.intl.setLocale([locale]); } - redirect(_: unknown, { to }: Transition) { + redirect(_/* : unknown */, { to }/*: Transition*/) { if (Ember.testing) { // skip testing bahavour for now return; diff --git a/frontend/app/transforms/full-date.ts b/frontend/app/transforms/full-date.ts index 2ef44a5ac..dff05e9b0 100644 --- a/frontend/app/transforms/full-date.ts +++ b/frontend/app/transforms/full-date.ts @@ -1,20 +1,18 @@ // eslint-disable-next-line ember/use-ember-data-rfc-395-imports import DS from 'ember-data'; import { DateTime } from 'luxon'; -import { inject as service } from '@ember/service'; -import UserDataService from 'brn/services/user-data'; const { DateTransform } = DS; -const FullDate = DateTransform.extend({ - userData: service('user-data'), +class FullDate extends DateTransform { deserialize(serialized: Record): DateTime | null { - const locale = (this.userData as unknown as UserDataService).activeLocale as unknown as string + // + const browserLocale = (navigator && navigator.language) || 'en'; return ( (serialized && - DateTime.fromISO(serialized as unknown as string, { zone: 'utc', locale })) || + DateTime.fromISO(serialized as unknown as string, { zone: 'utc', locale: browserLocale })) || null ); - }, -}); + } +} declare module 'ember-data/types/registries/transform' { export default interface TransformRegistry { diff --git a/frontend/mirage/config.js b/frontend/mirage/config.js index 99fdd88ab..b5835b8ab 100644 --- a/frontend/mirage/config.js +++ b/frontend/mirage/config.js @@ -1,6 +1,26 @@ +import { + discoverEmberDataModels, +} from 'ember-cli-mirage'; +import { createServer } from 'miragejs'; + + /* eslint-disable @typescript-eslint/no-empty-function */ -export default function() { - this.passthrough('/write-coverage'); +export default function(config) { + + let finalConfig = { + ...config, + models: { + ...discoverEmberDataModels(config.store), + ...config.models + }, + routes, + }; + + return createServer(finalConfig); + +} +export function routes() { + this.passthrough('/write-coverage'); // These comments are here to help you get started. Feel free to delete them. @@ -24,23 +44,22 @@ export default function() { https://www.ember-cli-mirage.com/docs/route-handlers/shorthands */ - this.namespace = 'api' - this.timing = 10; - this.get('/users/current', ()=>{ - return { - data: { - firstName: 'First-Name', - lastName: 'Last-Name', - email: 'em@il' - } - } - }); - this.get('/v2/statistics/study/week', () => {}); - this.get('/v2/statistics/study/year', () => {} ); - this.resource('groups'); - this.resource('series'); - this.resource('exercises'); - this.resource('tasks'); - this.resource('study-history'); - + this.namespace = 'api' + this.timing = 10; + this.get('/users/current', ()=>{ + return { + data: { + firstName: 'First-Name', + lastName: 'Last-Name', + email: 'em@il' + } + } + }); + this.get('/v2/statistics/study/week', () => {}); + this.get('/v2/statistics/study/year', () => {} ); + this.resource('groups'); + this.resource('series'); + this.resource('exercises'); + this.resource('tasks'); + this.resource('study-history'); } diff --git a/frontend/mirage/factories/group.js b/frontend/mirage/factories/group.js index 8353b6bda..ace623515 100644 --- a/frontend/mirage/factories/group.js +++ b/frontend/mirage/factories/group.js @@ -1,4 +1,5 @@ -import { Factory, trait, } from 'ember-cli-mirage'; +import { Factory, trait } from 'miragejs'; + export default Factory.extend({ name: (i)=> `Group ${i+1}`, diff --git a/frontend/mirage/models/exercise.js b/frontend/mirage/models/exercise.js index cebab83e4..a47a1cce5 100644 --- a/frontend/mirage/models/exercise.js +++ b/frontend/mirage/models/exercise.js @@ -1,4 +1,4 @@ -import { Model, belongsTo, hasMany, } from 'ember-cli-mirage'; +import { Model, belongsTo, hasMany, } from 'miragejs'; export default Model.extend({ series: belongsTo(), diff --git a/frontend/mirage/models/group.js b/frontend/mirage/models/group.js index 029721b8b..a28188c85 100644 --- a/frontend/mirage/models/group.js +++ b/frontend/mirage/models/group.js @@ -1,4 +1,4 @@ -import { Model, hasMany, } from 'ember-cli-mirage'; +import { Model, hasMany, } from 'miragejs'; export default Model.extend({ series: hasMany(), diff --git a/frontend/mirage/models/series.js b/frontend/mirage/models/series.js index ff03783c8..ec45e76d2 100644 --- a/frontend/mirage/models/series.js +++ b/frontend/mirage/models/series.js @@ -1,4 +1,4 @@ -import { Model, hasMany, belongsTo,} from 'ember-cli-mirage'; +import { Model, hasMany, belongsTo,} from 'miragejs'; export default Model.extend({ group: belongsTo(), diff --git a/frontend/mirage/models/task.js b/frontend/mirage/models/task.js index 8811fd196..fc545ac1a 100644 --- a/frontend/mirage/models/task.js +++ b/frontend/mirage/models/task.js @@ -1,4 +1,4 @@ -import { Model, belongsTo, } from 'ember-cli-mirage'; +import { Model, belongsTo, } from 'miragejs'; export default Model.extend({ exercise: belongsTo(), diff --git a/frontend/mirage/serializers/application.js b/frontend/mirage/serializers/application.js index 29bd84d84..5ea549401 100644 --- a/frontend/mirage/serializers/application.js +++ b/frontend/mirage/serializers/application.js @@ -1,6 +1,6 @@ -import { RestSerializer, } from 'ember-cli-mirage'; +import { EmberDataSerializer } from "ember-cli-mirage"; -export default RestSerializer.extend({ +export default EmberDataSerializer.extend({ keyForModel:()=>'data', keyForRelationshipIds:(key)=> key, keyForForeignKey:(key)=> key, diff --git a/frontend/package.json b/frontend/package.json index dec7dd515..477f51112 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -25,7 +25,7 @@ "on:precommit": "lint-staged", "local": "ember s --secure-proxy=false --proxy=http://localhost:8081", "develop": "cross-env FIREBASE_PROJECT_ID=brainup-spb-dev-bb6d0 FIREBASE_AUTH_DOMAIN=brainup-spb-dev-bb6d0.firebaseapp.com FIREBASE_API_KEY=AIzaSyB03Q4ZCxdqaKuN7cJqCQGhkibYD4Q-qsc ember s --secure-proxy=false --proxy=http://localhost:8081", - "remote": "ember s --secure-proxy=true --proxy=https://brainup.site/", + "remote": "ember s --secure-proxy=false --proxy=https://brainup.site/", "mirage": "ember s", "postinstall": "patch-package" }, @@ -61,7 +61,6 @@ "ember-component-css/broccoli-replace/applause/lodash": "^4.17.12", "ember-cli/ember-cli-preprocess-registry/broccoli-clean-css/clean-css-promise/clean-css": "^4.1.11", "ember-cli/bower-config/optimist/minimist": "^1.2.3", - "ember-cli-postcss/merge": "2.1.1", "ember-component-css/postcss/nanoid": ">=3.1.31", "ember-component-css/postcss-less/postcss/nanoid": ">=3.1.31", "tailwindcss/@fullhuman/postcss-purgecss/purgecss/postcss/nanoid": ">=3.1.31", @@ -69,7 +68,8 @@ "firebase/@firebase/firestore/@grpc/proto-loader/protobufjs": ">=6.11.3", "*/@babel/types/lodash": ">=4.17.19", "**/glob-parent": ">=5.1.2", - "**/@embroider/macros": "1.0.0", + "**/@embroider/macros": "1.16.9", + "@embroider/macros": "1.16.9", "**/watch-detector": "1.0.1", "**/trim-newlines": ">=3.0.1", "**/ws": ">=7.4.6", @@ -90,24 +90,23 @@ "*/jquery": "3.5.0", "**/postcss": ">=8.2.10", "**/path-parse": ">=1.0.7", - "ember-cli/testem": "3.4.2", "**/ansi-regex": "5.0.1" }, "devDependencies": { "@ember/optional-features": "^2.0.0", - "@ember/render-modifiers": "^1.0.2", - "@ember/test-helpers": "^2.6.0", + "@ember/render-modifiers": "2.1.0", + "@ember/test-helpers": "4.0.4", "@fortawesome/ember-fontawesome": "^0.3.0", "@fortawesome/free-solid-svg-icons": "^5.14.0", "@fullhuman/postcss-purgecss": "^3.0.0", - "@glimmer/component": "^1.0.3", - "@glimmer/tracking": "^1.0.3", - "@types/ember": "^3.16.2", - "@types/ember-data": "^3.16.8", - "@types/ember-data__adapter": "^3.16.1", - "@types/ember-data__model": "^3.16.2", - "@types/ember-data__serializer": "^3.16.1", - "@types/ember-data__store": "^3.16.1", + "@glimmer/component": "1.1.2", + "@glimmer/tracking": "1.1.2", + "@types/ember": "4.0.11", + "@types/ember-data": "4.4.16", + "@types/ember-data__adapter": "4.0.6", + "@types/ember-data__model": "4.0.5", + "@types/ember-data__serializer": "4.0.6", + "@types/ember-data__store": "4.0.7", "@types/ember-qunit": "^3.4.9", "@types/ember-resolver": "^5.0.9", "@types/ember__test-helpers": "^1.7.2", @@ -120,41 +119,42 @@ "broccoli-asset-rev": "^3.0.0", "cross-env": "^7.0.2", "els-component-extraction-addon": "^0.1.12", - "els-intl-addon": "^1.0.3", - "ember-auto-import": "^1.10.1", - "ember-cli": "~3.28.4", + "ember-auto-import": "2.10.0", + "ember-cli": "4.12.1", + "@babel/core": "7.26.0", + "@ember/string": "3.1.1", "ember-cli-app-version": "^4.0.0", "ember-cli-babel": "^7.26.11", "ember-cli-code-coverage": "^1.0.0-beta.8", - "ember-cli-dependency-checker": "^3.2.0", + "ember-cli-dependency-checker": "3.3.2", "ember-cli-deploy": "^1.0.2", "ember-cli-deploy-build": "^2.0.0", "ember-cli-htmlbars": "^5.7.2", "ember-cli-inject-live-reload": "^2.0.2", - "ember-cli-mirage": "^2.4.0", + "ember-cli-mirage": "3.0.4", "ember-cli-page-object": "v2.0.0-beta.2", - "ember-cli-postcss": "^7.0.0", + "ember-cli-postcss": "8.2.0", "ember-cli-sri": "^2.1.1", "ember-cli-terser": "^4.0.2", "ember-composable-helpers": "^3.1.0", "ember-concurrency": "^2.2.0", - "ember-data": "3.28.7", + "ember-data": "4.12.3", + "miragejs": "0.1.48", "ember-export-application-global": "^2.0.1", - "ember-fetch": "^8.0.2", + "ember-fetch": "8.1.2", "ember-firebase-service": "^9.0.1", - "ember-href-to": "^4.0.0", - "ember-intl": "^5.5.0", + "ember-intl": "7.0.7", "ember-load-initializers": "^2.1.2", - "ember-modal-dialog": "4.0.0-alpha.1", - "ember-modifier": "3.0.0", + "ember-modal-dialog": "4.1.4", + "ember-modifier": "4.2.0", "ember-page-title": "^6.0.3", - "ember-qunit": "^5.1.5", - "ember-ref-bucket": "^4.0.0", - "ember-resolver": "^8.0.2", + "ember-qunit": "8.1.1", + "ember-ref-bucket": "5.0.7", + "ember-resolver": "13.0.2", "ember-router-helpers": "^0.4.0", - "ember-simple-auth": "^3.0.0", + "ember-simple-auth": "4.2.2", "ember-sinon": "^5.0.0", - "ember-source": "3.28.8", + "ember-source": "4.12.4", "ember-template-lint": "^2.15.0", "ember-template-lint-plugin-tailwindcss": "1.0.0", "ember-test-selectors": "^6.0.0", @@ -176,12 +176,13 @@ "typescript": "^4.5.5" }, "engines": { - "node": ">= 12" + "node": ">= 22" }, "ember": { "edition": "octane" }, "dependencies": { + "webpack": "5.96.1", "@ffmpeg/core": "^0.10.0", "@ffmpeg/ffmpeg": "^0.10.1", "billboard.js": "^3.1.0", @@ -199,7 +200,7 @@ "tone": "^14.7.60" }, "volta": { - "node": "14.18.2", + "node": "22.11.0", "yarn": "1.22.10" }, "ember-addon": { diff --git a/frontend/patches/broccoli-babel-transpiler+7.8.1.patch b/frontend/patches/broccoli-babel-transpiler+7.8.1.patch new file mode 100644 index 000000000..8cd57387f --- /dev/null +++ b/frontend/patches/broccoli-babel-transpiler+7.8.1.patch @@ -0,0 +1,35 @@ +diff --git a/node_modules/broccoli-babel-transpiler/index.js b/node_modules/broccoli-babel-transpiler/index.js +index f27d48e..fdc7732 100644 +--- a/node_modules/broccoli-babel-transpiler/index.js ++++ b/node_modules/broccoli-babel-transpiler/index.js +@@ -86,7 +86,7 @@ function Babel(inputTree, _options) { + + heimdall.statsFor('babel').isParallelizable = isParallelizable; + +- if ((this.throwUnlessParallelizable || process.env.THROW_UNLESS_PARALLELIZABLE) && isParallelizable === false) { ++ if (false) { + throw new Error(this.toString() + + ' was configured to `throwUnlessParallelizable` and was unable to parallelize a plugin. \nplugins:\n' + joinCount(errors) + '\nPlease see: https://github.com/babel/broccoli-babel-transpiler#parallel-transpilation for more details'); + } +diff --git a/node_modules/broccoli-babel-transpiler/lib/parallel-api.js b/node_modules/broccoli-babel-transpiler/lib/parallel-api.js +index 4453beb..327b9ed 100644 +--- a/node_modules/broccoli-babel-transpiler/lib/parallel-api.js ++++ b/node_modules/broccoli-babel-transpiler/lib/parallel-api.js +@@ -69,7 +69,7 @@ function pluginsAreParallelizable(plugins) { + let plugin = plugins[i]; + if (isSerializable(plugin) === false) { + isParallelizable = false; +- errors.push(humanizePlugin(plugin)); ++ errors.push(plugin); + } + } + } +@@ -89,7 +89,7 @@ function callbacksAreParallelizable(options) { + let callback = options[callbacks[i]]; + if (implementsParallelAPI(callback) === false) { + isParallelizable = false; +- errors.push(humanizePlugin(callback)) ++ errors.push(callback) + } + } + diff --git a/frontend/tests/acceptance/exercise-availability/exercises-availability-test.js b/frontend/tests/acceptance/exercise-availability/exercises-availability-test.js index c8dd7dcbb..7eb32715a 100644 --- a/frontend/tests/acceptance/exercise-availability/exercises-availability-test.js +++ b/frontend/tests/acceptance/exercise-availability/exercises-availability-test.js @@ -7,7 +7,7 @@ import { } from '../general-helpers'; import { getTestData } from './test-support/data-storage'; import pageObject from './test-support/page-object'; -import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; +import { setupMirage } from "ember-cli-mirage/test-support"; import { authenticateSession } from 'ember-simple-auth/test-support'; module('Acceptance | exercises availability', function (hooks) { diff --git a/frontend/tests/acceptance/series-availability/series-availability-test.js b/frontend/tests/acceptance/series-availability/series-availability-test.js index 2ab49eab0..c05b615aa 100644 --- a/frontend/tests/acceptance/series-availability/series-availability-test.js +++ b/frontend/tests/acceptance/series-availability/series-availability-test.js @@ -5,7 +5,7 @@ import { getServerResponses } from '../general-helpers'; import { getTestData } from './test-suport/data-storage'; import { authenticateSession } from 'ember-simple-auth/test-support'; import pageObject from './test-suport/page-object'; -import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; +import { setupMirage } from "ember-cli-mirage/test-support"; module('Acceptance | active seria highlighting test', function (hooks) { setupApplicationTest(hooks); diff --git a/frontend/tests/acceptance/task-flow/tasks-flow-test.js b/frontend/tests/acceptance/task-flow/tasks-flow-test.js index c16ba4448..af776c56e 100644 --- a/frontend/tests/acceptance/task-flow/tasks-flow-test.js +++ b/frontend/tests/acceptance/task-flow/tasks-flow-test.js @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-empty-function */ import { module, skip, test } from 'qunit'; -import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; +import { setupMirage } from "ember-cli-mirage/test-support"; import { setupApplicationTest } from 'ember-qunit'; import pageObject from './test-support/page-object'; import { setupAfterPageVisit } from './test-support/helpers'; diff --git a/frontend/tests/acceptance/unaccessible-routes/unaccessible-routes-test.js b/frontend/tests/acceptance/unaccessible-routes/unaccessible-routes-test.js index aa21f18d8..43d606123 100644 --- a/frontend/tests/acceptance/unaccessible-routes/unaccessible-routes-test.js +++ b/frontend/tests/acceptance/unaccessible-routes/unaccessible-routes-test.js @@ -1,6 +1,6 @@ import { module, skip } from 'qunit'; import { currentURL } from '@ember/test-helpers'; -import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; +import { setupMirage } from "ember-cli-mirage/test-support"; import { setupApplicationTest } from 'ember-qunit'; import pageObject from './test-support/page-object'; import { authenticateSession } from 'ember-simple-auth/test-support'; diff --git a/frontend/tests/integration/components/answer-correctness-widget/component-test.js b/frontend/tests/integration/components/answer-correctness-widget/component-test.js index a81cea107..e82eee45e 100644 --- a/frontend/tests/integration/components/answer-correctness-widget/component-test.js +++ b/frontend/tests/integration/components/answer-correctness-widget/component-test.js @@ -1,10 +1,10 @@ import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; +import { setupIntl } from 'ember-intl/test-support';import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; module('Integration | Component | answer-correctness-widget', function (hooks) { - setupRenderingTest(hooks); + setupRenderingTest(hooks);setupIntl(hooks, 'en-us'); test('gets victory image if isCorrect', async function (assert) { await render(hbs``); diff --git a/frontend/tests/integration/components/audio-player/component-test.js b/frontend/tests/integration/components/audio-player/component-test.js index dc48d47c8..e6a0f1940 100644 --- a/frontend/tests/integration/components/audio-player/component-test.js +++ b/frontend/tests/integration/components/audio-player/component-test.js @@ -1,5 +1,5 @@ import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; +import { setupIntl } from 'ember-intl/test-support';import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; import { timeout } from 'ember-concurrency'; @@ -9,7 +9,7 @@ import customTimeout from 'brn/utils/custom-timeout'; import Service from '@ember/service'; module('Integration | Component | audio-player', function (hooks) { - setupRenderingTest(hooks); + setupRenderingTest(hooks);setupIntl(hooks, 'en-us'); hooks.beforeEach(async function () { const fakeAudio = { diff --git a/frontend/tests/integration/components/breadcrumbs/component-test.js b/frontend/tests/integration/components/breadcrumbs/component-test.js index c05766784..46872bc1d 100644 --- a/frontend/tests/integration/components/breadcrumbs/component-test.js +++ b/frontend/tests/integration/components/breadcrumbs/component-test.js @@ -1,11 +1,11 @@ import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; +import { setupIntl } from 'ember-intl/test-support';import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; -import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; +import { setupMirage } from "ember-cli-mirage/test-support"; module('Integration | Component | breadcrumbs', function (hooks) { - setupRenderingTest(hooks); + setupRenderingTest(hooks);setupIntl(hooks, 'en-us'); setupMirage(hooks); test('it shows group link', async function (assert) { diff --git a/frontend/tests/integration/components/exercise-group-test.js b/frontend/tests/integration/components/exercise-group-test.js index 818a79163..8b460d96e 100644 --- a/frontend/tests/integration/components/exercise-group-test.js +++ b/frontend/tests/integration/components/exercise-group-test.js @@ -1,9 +1,9 @@ import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; +import { setupIntl } from 'ember-intl/test-support';import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; module('Integration | Component | exercise-group', function (hooks) { - setupRenderingTest(hooks); + setupRenderingTest(hooks);setupIntl(hooks, 'en-us'); test('it renders', async function (assert) { this.set('group', { picture: 'any', diff --git a/frontend/tests/integration/components/exercise-stats/component-test.js b/frontend/tests/integration/components/exercise-stats/component-test.js index e84e04ea9..1f9f2b0ca 100644 --- a/frontend/tests/integration/components/exercise-stats/component-test.js +++ b/frontend/tests/integration/components/exercise-stats/component-test.js @@ -1,10 +1,10 @@ import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; +import { setupIntl } from 'ember-intl/test-support';import { setupRenderingTest } from 'ember-qunit'; import { render, click } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; module('Integration | Component | exercise-stats', function (hooks) { - setupRenderingTest(hooks); + setupRenderingTest(hooks);setupIntl(hooks, 'en-us'); test('it renders', async function (assert) { this.set('stats', { diff --git a/frontend/tests/integration/components/exercise-stats/panel/component-test.js b/frontend/tests/integration/components/exercise-stats/panel/component-test.js index 3709ee684..452ead447 100644 --- a/frontend/tests/integration/components/exercise-stats/panel/component-test.js +++ b/frontend/tests/integration/components/exercise-stats/panel/component-test.js @@ -1,10 +1,10 @@ import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; +import { setupIntl } from 'ember-intl/test-support';import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; module('Integration | Component | exercise-stats/panel', function (hooks) { - setupRenderingTest(hooks); + setupRenderingTest(hooks);setupIntl(hooks, 'en-us'); test('it renders', async function (assert) { // Set any properties with this.set('myProperty', 'value'); diff --git a/frontend/tests/integration/components/exercise-steps/component-test.js b/frontend/tests/integration/components/exercise-steps/component-test.js index fe25250b0..987806e69 100644 --- a/frontend/tests/integration/components/exercise-steps/component-test.js +++ b/frontend/tests/integration/components/exercise-steps/component-test.js @@ -1,10 +1,10 @@ import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; +import { setupIntl } from 'ember-intl/test-support';import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; module('Integration | Component | exercise-steps', function (hooks) { - setupRenderingTest(hooks); + setupRenderingTest(hooks);setupIntl(hooks, 'en-us'); test('it renders', async function (assert) { // Set any properties with this.set('myProperty', 'value'); diff --git a/frontend/tests/integration/components/exercise-steps/step/component-test.js b/frontend/tests/integration/components/exercise-steps/step/component-test.js index a3fd82dd8..e39f42199 100644 --- a/frontend/tests/integration/components/exercise-steps/step/component-test.js +++ b/frontend/tests/integration/components/exercise-steps/step/component-test.js @@ -1,10 +1,10 @@ import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; +import { setupIntl } from 'ember-intl/test-support';import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; module('Integration | Component | exercise-steps/step', function (hooks) { - setupRenderingTest(hooks); + setupRenderingTest(hooks);setupIntl(hooks, 'en-us'); test('it renders', async function (assert) { // Set any properties with this.set('myProperty', 'value'); diff --git a/frontend/tests/integration/components/exercise-study-config-test.js b/frontend/tests/integration/components/exercise-study-config-test.js index dff8136de..268b4cb88 100644 --- a/frontend/tests/integration/components/exercise-study-config-test.js +++ b/frontend/tests/integration/components/exercise-study-config-test.js @@ -1,17 +1,17 @@ import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; +import { setupIntl } from 'ember-intl/test-support';import { setupRenderingTest } from 'ember-qunit'; import { render, click } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; module('Integration | Component | exercise-study-config', function(hooks) { - setupRenderingTest(hooks); + setupRenderingTest(hooks);setupIntl(hooks, 'en-us'); test('it renders', async function(assert) { // Set any properties with this.set('myProperty', 'value'); // Handle any actions with this.set('myAction', function(val) { ... }); const controller = this.owner.lookup('controller:group.series.subgroup.exercise.task'); - + controller.set('model', { shouldBeWithPictures: true, }); @@ -30,7 +30,7 @@ module('Integration | Component | exercise-study-config', function(hooks) { // Handle any actions with this.set('myAction', function(val) { ... }); const controller = this.owner.lookup('controller:group.series.subgroup.exercise.task'); - + controller.set('model', { shouldBeWithPictures: false, }); diff --git a/frontend/tests/integration/components/exercise-type/component-test.js b/frontend/tests/integration/components/exercise-type/component-test.js index 3533a3210..b72f723eb 100644 --- a/frontend/tests/integration/components/exercise-type/component-test.js +++ b/frontend/tests/integration/components/exercise-type/component-test.js @@ -1,10 +1,10 @@ import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; +import { setupIntl } from 'ember-intl/test-support';import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; module('Integration | Component | exercise-type', function (hooks) { - setupRenderingTest(hooks); + setupRenderingTest(hooks);setupIntl(hooks, 'en-us'); test('it renders', async function (assert) { // Set any properties with this.set('myProperty', 'value'); diff --git a/frontend/tests/integration/components/footer/component-test.js b/frontend/tests/integration/components/footer/component-test.js index ff0fe5ed7..bdc4bf8ad 100644 --- a/frontend/tests/integration/components/footer/component-test.js +++ b/frontend/tests/integration/components/footer/component-test.js @@ -1,10 +1,10 @@ import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; +import { setupIntl } from 'ember-intl/test-support';import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; module('Integration | Component | footer', function (hooks) { - setupRenderingTest(hooks); + setupRenderingTest(hooks);setupIntl(hooks, 'en-us'); test('it renders', async function (assert) { await render(hbs`