diff --git a/.github/file-filters.yml b/.github/file-filters.yml new file mode 100644 index 000000000..e41dfb6d8 --- /dev/null +++ b/.github/file-filters.yml @@ -0,0 +1,31 @@ +# These file filter patterns are used by the action https://github.com/dorny/paths-filter + +# more differentiated filters for admin interface, which might be used later +# admin_locales: &admin_locales +# - 'admin/src/locales/**' +# - 'admin/scripts/sort*' + +# admin_stylelinting: &admin_stylelinting +# - 'admin/{components,layouts,pages}/**/*.{scss,vue}' +# - 'admin/.stylelintrc.js' + +# admin_linting: &admin_linting +# - 'admin/.eslint*' +# - 'admin/babel.config.js' +# - 'admin/package.json' +# - 'admin/**/*.{js,vue}' +# - *admin_locales + +# admin_unit_testing: &admin_unit_testing +# - 'admin/package.json' +# - 'admin/{jest,vue}.config.js' +# - 'admin/{public,run,test}/**/*' +# - 'admin/src/!(locales)/**/*' + +# admin_docker_building: &admin_docker_building +# - 'admin/.dockerignore' +# - 'admin/Dockerfile' +# - *admin_unit_testing + +admin: &admin + - 'admin/**/*' \ No newline at end of file diff --git a/.github/workflows/test-admin-interface.yml b/.github/workflows/test-admin-interface.yml new file mode 100644 index 000000000..a163af4e9 --- /dev/null +++ b/.github/workflows/test-admin-interface.yml @@ -0,0 +1,84 @@ +name: Gradido Admin Interface Test CI + +on: push + +jobs: + # only (but most important) job from this workflow required for pull requests + # check results serve as run conditions for all other jobs here + files-changed: + name: Detect File Changes - Admin Interface + runs-on: ubuntu-latest + outputs: + admin: ${{ steps.changes.outputs.admin }} + steps: + - uses: actions/checkout@v3.3.0 + + - name: Check for admin interface file changes + uses: dorny/paths-filter@v2.11.1 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-filters.yml + list-files: shell + + + build_test: + if: needs.files-changed.outputs.admin == 'true' + name: Docker Build Test - Admin Interface + needs: files-changed + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Admin Interface | Build 'test' image + run: docker build --target test -t "gradido/admin:test" admin/ --build-arg NODE_ENV="test" + + unit_test: + if: needs.files-changed.outputs.admin == 'true' + name: Unit Tests - Admin Interface + needs: files-changed + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Admin Interface | Unit tests + run: cd admin && yarn && yarn run test + + lint: + if: needs.files-changed.outputs.admin == 'true' + name: Lint - Admin Interface + needs: files-changed + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Admin Interface | Lint + run: cd admin && yarn && yarn run lint + + stylelint: + if: needs.files-changed.outputs.admin == 'true' + name: Stylelint - Admin Interface + needs: files-changed + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Admin Interface | Stylelint + run: cd admin && yarn && yarn run stylelint + + locales: + if: needs.files-changed.outputs.admin == 'true' + name: Locales - Admin Interface + needs: files-changed + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Admin Interface | Locales + run: cd admin && yarn && yarn run locales diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 573cd911a..7a9243af9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,31 +29,6 @@ jobs: name: docker-frontend-test path: /tmp/frontend.tar - ############################################################################## - # JOB: DOCKER BUILD TEST ADMIN INTERFACE ##################################### - ############################################################################## - build_test_admin: - name: Docker Build Test - Admin Interface - runs-on: ubuntu-latest - steps: - ########################################################################## - # CHECKOUT CODE ########################################################## - ########################################################################## - - name: Checkout code - uses: actions/checkout@v3 - ########################################################################## - # ADMIN INTERFACE ######################################################## - ########################################################################## - - name: Admin | Build `test` image - run: | - docker build --target test -t "gradido/admin:test" admin/ --build-arg NODE_ENV="test" - docker save "gradido/admin:test" > /tmp/admin.tar - - name: Upload Artifact - uses: actions/upload-artifact@v3 - with: - name: docker-admin-test - path: /tmp/admin.tar - ############################################################################## # JOB: DOCKER BUILD TEST BACKEND ############################################# ############################################################################## @@ -211,60 +186,6 @@ jobs: - name: Frontend | Stylelint run: cd frontend && yarn && yarn run stylelint - ############################################################################## - # JOB: LINT ADMIN INTERFACE ################################################## - ############################################################################## - lint_admin: - name: Lint - Admin Interface - runs-on: ubuntu-latest - steps: - ########################################################################## - # CHECKOUT CODE ########################################################## - ########################################################################## - - name: Checkout code - uses: actions/checkout@v3 - ########################################################################## - # LINT ADMIN INTERFACE ################################################### - ########################################################################## - - name: Admin Interface | Lint - run: cd admin && yarn && yarn run lint - - ############################################################################## - # JOB: STYLELINT ADMIN INTERFACE ############################################# - ############################################################################## - stylelint_admin: - name: Stylelint - Admin Interface - runs-on: ubuntu-latest - steps: - ########################################################################## - # CHECKOUT CODE ########################################################## - ########################################################################## - - name: Checkout code - uses: actions/checkout@v3 - ########################################################################## - # STYLELINT ADMIN INTERFACE ############################################## - ########################################################################## - - name: Admin Interface | Stylelint - run: cd admin && yarn && yarn run stylelint - - ############################################################################## - # JOB: LOCALES ADMIN ######################################################### - ############################################################################## - locales_admin: - name: Locales - Admin Interface - runs-on: ubuntu-latest - steps: - ########################################################################## - # CHECKOUT CODE ########################################################## - ########################################################################## - - name: Checkout code - uses: actions/checkout@v3 - ########################################################################## - # LOCALES FRONTEND ####################################################### - ########################################################################## - - name: Admin | Locales - run: cd admin && yarn && yarn run locales - ############################################################################## # JOB: LINT BACKEND ########################################################## ############################################################################## @@ -335,51 +256,7 @@ jobs: # UNIT TESTS FRONTEND #################################################### ########################################################################## - name: Frontend | Unit tests - run: | - cd frontend && yarn && yarn run test - cp -r ./coverage ../ - ########################################################################## - # COVERAGE CHECK FRONTEND ################################################ - ########################################################################## - - name: frontend | Coverage check - uses: webcraftmedia/coverage-check-action@master - with: - report_name: Coverage Frontend - type: lcov - result_path: ./frontend/coverage/lcov.info - min_coverage: 95 - token: ${{ github.token }} - - ############################################################################## - # JOB: UNIT TEST ADMIN INTERFACE ############################################# - ############################################################################## - unit_test_admin: - name: Unit tests - Admin Interface - runs-on: ubuntu-latest - steps: - ########################################################################## - # CHECKOUT CODE ########################################################## - ########################################################################## - - name: Checkout code - uses: actions/checkout@v3 - ########################################################################## - # UNIT TESTS ADMIN INTERFACE ############################################# - ########################################################################## - - name: Admin Interface | Unit tests - run: | - cd admin && yarn && yarn run test - cp -r ./coverage ../ - ########################################################################## - # COVERAGE CHECK ADMIN INTERFACE ######################################### - ########################################################################## - - name: Admin Interface | Coverage check - uses: webcraftmedia/coverage-check-action@master - with: - report_name: Coverage Admin Interface - type: lcov - result_path: ./admin/coverage/lcov.info - min_coverage: 97 - token: ${{ github.token }} + run: cd frontend && yarn && yarn run test ############################################################################## # JOB: UNIT TEST BACKEND #################################################### @@ -415,20 +292,7 @@ jobs: - name: backend | docker-compose database run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps database - name: backend Unit tests | test - run: | - cd database && yarn && yarn build && cd ../backend && yarn && yarn test - cp -r ./coverage ../ - ########################################################################## - # COVERAGE CHECK BACKEND ################################################# - ########################################################################## - - name: backend | Coverage check - uses: webcraftmedia/coverage-check-action@master - with: - report_name: Coverage Backend - type: lcov - result_path: ./backend/coverage/lcov.info - min_coverage: 80 - token: ${{ github.token }} + run: cd database && yarn && yarn build && cd ../backend && yarn && yarn test ########################################################################## # DATABASE MIGRATION TEST UP + RESET ##################################### @@ -459,7 +323,7 @@ jobs: end-to-end-tests: name: End-to-End Tests runs-on: ubuntu-latest - needs: [build_test_mariadb, build_test_database_up, build_test_admin, build_test_frontend, build_test_nginx] + needs: [build_test_mariadb, build_test_database_up, build_test_frontend, build_test_nginx] steps: ########################################################################## # CHECKOUT CODE ########################################################## @@ -490,13 +354,6 @@ jobs: path: /tmp - name: Load Docker Image (Frontend) run: docker load < /tmp/frontend.tar - - name: Download Docker Image (Admin Interface) - uses: actions/download-artifact@v3 - with: - name: docker-admin-test - path: /tmp - - name: Load Docker Image (Admin Interface) - run: docker load < /tmp/admin.tar - name: Download Docker Image (Nginx) uses: actions/download-artifact@v3 with: @@ -550,7 +407,7 @@ jobs: run: | cd e2e-tests/ yarn - yarn run cypress run --spec cypress/e2e/User.Authentication.feature,cypress/e2e/User.Authentication.ResetPassword.feature,cypress/e2e/User.Registration.feature + yarn run cypress run - name: End-to-end tests | if tests failed, upload screenshots if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }} uses: actions/upload-artifact@v3 diff --git a/.github/workflows/test_dht-node.yml b/.github/workflows/test_dht-node.yml index 4ac475351..fbda230ee 100644 --- a/.github/workflows/test_dht-node.yml +++ b/.github/workflows/test_dht-node.yml @@ -83,16 +83,4 @@ jobs: #- name: Unit tests # run: cd database && yarn && yarn build && cd ../dht-node && yarn && yarn test - name: Unit tests - run: | - docker run --env NODE_ENV=test --env DB_HOST=mariadb --network gradido_internal-net -v ~/coverage:/app/coverage --rm gradido/dht-node:test yarn run test - cp -r ~/coverage ./coverage - - - name: Coverage check - uses: webcraftmedia/coverage-check-action@master - with: - report_name: Coverage DHT Node - type: lcov - #result_path: ./dht-node/coverage/lcov.info - result_path: ./coverage/lcov.info - min_coverage: 79 - token: ${{ github.token }} + run: docker run --env NODE_ENV=test --env DB_HOST=mariadb --network gradido_internal-net --rm gradido/dht-node:test yarn run test diff --git a/.github/workflows/test_federation.yml b/.github/workflows/test_federation.yml index ab943eedd..7d92f1f84 100644 --- a/.github/workflows/test_federation.yml +++ b/.github/workflows/test_federation.yml @@ -84,15 +84,4 @@ jobs: # run: cd database && yarn && yarn build && cd ../dht-node && yarn && yarn test - name: Unit tests run: | - docker run --env NODE_ENV=test --env DB_HOST=mariadb --network gradido_internal-net -v ~/coverage:/app/coverage --rm gradido/federation:test yarn run test - cp -r ~/coverage ./coverage - - - name: Coverage check - uses: webcraftmedia/coverage-check-action@master - with: - report_name: Coverage Federation - type: lcov - #result_path: ./federation/coverage/lcov.info - result_path: ./coverage/lcov.info - min_coverage: 72 - token: ${{ github.token }} + docker run --env NODE_ENV=test --env DB_HOST=mariadb --network gradido_internal-net --rm gradido/federation:test yarn run test diff --git a/admin/jest.config.js b/admin/jest.config.js index 9233dd2e7..b6ec1dc80 100644 --- a/admin/jest.config.js +++ b/admin/jest.config.js @@ -1,11 +1,17 @@ module.exports = { verbose: true, + collectCoverage: true, collectCoverageFrom: [ 'src/**/*.{js,vue}', '!**/node_modules/**', '!src/assets/**', '!**/?(*.)+(spec|test).js?(x)', ], + coverageThreshold: { + global: { + lines: 97, + }, + }, moduleFileExtensions: [ 'js', // 'jsx', diff --git a/admin/package.json b/admin/package.json index 10399739d..3406c326a 100644 --- a/admin/package.json +++ b/admin/package.json @@ -14,7 +14,7 @@ "analyse-bundle": "yarn build && webpack-bundle-analyzer dist/webpack.stats.json", "lint": "eslint --max-warnings=0 --ext .js,.vue,.json .", "stylelint": "stylelint --max-warnings=0 '**/*.{scss,vue}'", - "test": "cross-env TZ=UTC jest --coverage", + "test": "cross-env TZ=UTC jest", "locales": "scripts/sort.sh" }, "dependencies": { diff --git a/admin/src/locales/en.json b/admin/src/locales/en.json index de7d3b871..f36944a63 100644 --- a/admin/src/locales/en.json +++ b/admin/src/locales/en.json @@ -39,7 +39,7 @@ }, "created": "Created for", "createdAt": "Created at", - "creation": "Amount", + "creation": "Creation", "creationList": "Creation list", "creation_form": { "creation_for": "Active Basic Income for", diff --git a/backend/.env.test_e2e b/backend/.env.test_e2e index a5cdc4bfd..99d6c14d5 100644 --- a/backend/.env.test_e2e +++ b/backend/.env.test_e2e @@ -1,5 +1,5 @@ # Server -JWT_EXPIRES_IN=1m +JWT_EXPIRES_IN=2m # Email EMAIL=true diff --git a/backend/jest.config.js b/backend/jest.config.js index d6683d292..cd63f11d8 100644 --- a/backend/jest.config.js +++ b/backend/jest.config.js @@ -4,6 +4,11 @@ module.exports = { preset: 'ts-jest', collectCoverage: true, collectCoverageFrom: ['src/**/*.ts', '!**/node_modules/**', '!src/seeds/**', '!build/**'], + coverageThreshold: { + global: { + lines: 80, + }, + }, setupFiles: ['/test/testSetup.ts'], setupFilesAfterEnv: ['/test/extensions.ts'], modulePathIgnorePatterns: ['/build/'], diff --git a/backend/package.json b/backend/package.json index dab5e50af..22e75f4af 100644 --- a/backend/package.json +++ b/backend/package.json @@ -13,7 +13,7 @@ "start": "cross-env TZ=UTC TS_NODE_BASEURL=./build node -r tsconfig-paths/register build/src/index.js", "dev": "cross-env TZ=UTC nodemon -w src --ext ts --exec ts-node -r tsconfig-paths/register src/index.ts", "lint": "eslint --max-warnings=0 --ext .js,.ts .", - "test": "cross-env TZ=UTC NODE_ENV=development jest --runInBand --coverage --forceExit --detectOpenHandles", + "test": "cross-env TZ=UTC NODE_ENV=development jest --runInBand --forceExit --detectOpenHandles", "seed": "cross-env TZ=UTC NODE_ENV=development ts-node -r tsconfig-paths/register src/seeds/index.ts", "klicktipp": "cross-env TZ=UTC NODE_ENV=development ts-node -r tsconfig-paths/register src/util/klicktipp.ts", "locales": "scripts/sort.sh" diff --git a/database/package.json b/database/package.json index 91bcce3f7..6dc8acf8c 100644 --- a/database/package.json +++ b/database/package.json @@ -16,9 +16,7 @@ "dev_up": "cross-env TZ=UTC ts-node src/index.ts up", "dev_down": "cross-env TZ=UTC ts-node src/index.ts down", "dev_reset": "cross-env TZ=UTC ts-node src/index.ts reset", - "lint": "eslint --max-warnings=0 --ext .js,.ts .", - "seed:config": "ts-node ./node_modules/typeorm-seeding/dist/cli.js config", - "seed": "cross-env TZ=UTC ts-node src/index.ts seed" + "lint": "eslint --max-warnings=0 --ext .js,.ts ." }, "devDependencies": { "@types/faker": "^5.5.9", diff --git a/dht-node/jest.config.js b/dht-node/jest.config.js index 10c87bddb..fa00ed868 100644 --- a/dht-node/jest.config.js +++ b/dht-node/jest.config.js @@ -4,6 +4,11 @@ module.exports = { preset: 'ts-jest', collectCoverage: true, collectCoverageFrom: ['src/**/*.ts', '!**/node_modules/**', '!src/seeds/**', '!build/**'], + coverageThreshold: { + global: { + lines: 80, + }, + }, setupFiles: ['/test/testSetup.ts'], setupFilesAfterEnv: [], modulePathIgnorePatterns: ['/build/'], diff --git a/dht-node/package.json b/dht-node/package.json index ac9b88968..15426e606 100644 --- a/dht-node/package.json +++ b/dht-node/package.json @@ -13,7 +13,7 @@ "start": "cross-env TZ=UTC TS_NODE_BASEURL=./build node -r tsconfig-paths/register build/src/index.js", "dev": "cross-env TZ=UTC nodemon -w src --ext ts --exec ts-node -r dotenv/config -r tsconfig-paths/register src/index.ts", "lint": "eslint --max-warnings=0 --ext .js,.ts .", - "test": "cross-env TZ=UTC NODE_ENV=development jest --runInBand --coverage --forceExit --detectOpenHandles" + "test": "cross-env TZ=UTC NODE_ENV=development jest --runInBand --forceExit --detectOpenHandles" }, "dependencies": { "@hyperswarm/dht": "^6.4.4", diff --git a/e2e-tests/cypress.config.ts b/e2e-tests/cypress.config.ts index 9dff98a9b..7205ef9cb 100644 --- a/e2e-tests/cypress.config.ts +++ b/e2e-tests/cypress.config.ts @@ -56,7 +56,7 @@ export default defineConfig({ env: { backendURL: 'http://localhost:4000', mailserverURL: 'http://localhost:1080', - loginQuery: `query ($email: String!, $password: String!, $publisherId: Int) { + loginQuery: `mutation ($email: String!, $password: String!, $publisherId: Int) { login(email: $email, password: $password, publisherId: $publisherId) { email firstName @@ -69,7 +69,8 @@ export default defineConfig({ hasElopage publisherId isAdmin - creation + hideAmountGDD + hideAmountGDT __typename } }`, diff --git a/e2e-tests/cypress/e2e/User.Authentication.ResetPassword.feature b/e2e-tests/cypress/e2e/User.Authentication.ResetPassword.feature index b0f660709..50a29d320 100644 --- a/e2e-tests/cypress/e2e/User.Authentication.ResetPassword.feature +++ b/e2e-tests/cypress/e2e/User.Authentication.ResetPassword.feature @@ -5,13 +5,13 @@ Feature: User Authentication - reset password # TODO for these pre-conditions utilize seeding or API check, if user exists in test system # Background: # Given the following "users" are in the database: - # | email | password | name | - # | bibi@bloxberg.de | Aa12345_ | Bibi Bloxberg | + # | email | password | name | + # | raeuber@hotzenplotz.de | Aa12345_ | Räuber Hotzenplotz | Scenario: Reset password from signin page successfully Given the user navigates to page "/login" And the user navigates to the forgot password page - When the user enters the e-mail address "bibi@bloxberg.de" + When the user enters the e-mail address "raeuber@hotzenplotz.de" And the user submits the e-mail form Then the user receives an e-mail containing the "password reset" link When the user opens the "password reset" link in the browser @@ -19,7 +19,7 @@ Feature: User Authentication - reset password And the user repeats the password "12345Aa_" And the user submits the password form And the user clicks the sign in button - Then the user submits the credentials "bibi@bloxberg.de" "Aa12345_" + Then the user submits the credentials "raeuber@hotzenplotz.de" "Aa12345_" And the user cannot login - But the user submits the credentials "bibi@bloxberg.de" "12345Aa_" - And the user is logged in with username "Bibi Bloxberg" + But the user submits the credentials "raeuber@hotzenplotz.de" "12345Aa_" + And the user is logged in with username "Räuber Hotzenplotz" diff --git a/e2e-tests/cypress/e2e/UserProfile.ChangePassword.feature b/e2e-tests/cypress/e2e/UserProfile.ChangePassword.feature index aa853f6ff..b7aa6960c 100644 --- a/e2e-tests/cypress/e2e/UserProfile.ChangePassword.feature +++ b/e2e-tests/cypress/e2e/UserProfile.ChangePassword.feature @@ -5,14 +5,14 @@ Feature: User profile - change password Background: # TODO for these pre-conditions utilize seeding or API check, if user exists in test system # Given the following "users" are in the database: - # | email | password | name | - # | bibi@bloxberg.de | Aa12345_ | Bibi Bloxberg | | + # | email | password | name | + # | bob@baumeister.de | Aa12345_ | Bob der Baumeister | # TODO instead of credentials use the name of an user object (see seeds in backend) - Given the user is logged in as "bibi@bloxberg.de" "Aa12345_" + Given the user is logged in as "bob@baumeister.de" "Aa12345_" Scenario: Change password successfully - Given the user navigates to page "/profile" + Given the user navigates to page "/settings" And the user opens the change password menu When the user fills the password form with: | Old password | Aa12345_ | @@ -21,7 +21,7 @@ Feature: User profile - change password And the user submits the password form And the user is presented a "success" message And the user logs out - Then the user submits the credentials "bibi@bloxberg.de" "Aa12345_" + Then the user submits the credentials "bob@baumeister.de" "Aa12345_" And the user cannot login - But the user submits the credentials "bibi@bloxberg.de" "12345Aa_" - And the user is logged in with username "Bibi Bloxberg" + But the user submits the credentials "bob@baumeister.de" "12345Aa_" + And the user is logged in with username "Bob der Baumeister" diff --git a/e2e-tests/cypress/e2e/models/SideNavMenu.ts b/e2e-tests/cypress/e2e/models/SideNavMenu.ts index ccd177b66..b52f35ed4 100644 --- a/e2e-tests/cypress/e2e/models/SideNavMenu.ts +++ b/e2e-tests/cypress/e2e/models/SideNavMenu.ts @@ -11,7 +11,7 @@ export class SideNavMenu { } logout() { - cy.get(this.logoutMenu).click() + cy.get('.main-sidebar').find(this.logoutMenu).click() return this } } diff --git a/federation/jest.config.js b/federation/jest.config.js index 742f35fbb..dff5ab169 100644 --- a/federation/jest.config.js +++ b/federation/jest.config.js @@ -9,6 +9,11 @@ module.exports = { '!src/seeds/**', '!build/**', ], + coverageThreshold: { + global: { + lines: 72, + }, + }, setupFiles: ['/test/testSetup.ts'], setupFilesAfterEnv: [], modulePathIgnorePatterns: ['/build/'], diff --git a/federation/package.json b/federation/package.json index 8a0153cc5..e7e067435 100644 --- a/federation/package.json +++ b/federation/package.json @@ -11,7 +11,7 @@ "build": "tsc --build", "clean": "tsc --build --clean", "start": "cross-env TZ=UTC TS_NODE_BASEURL=./build node -r tsconfig-paths/register build/src/index.js", - "test": "cross-env TZ=UTC NODE_ENV=development jest --runInBand --coverage --forceExit --detectOpenHandles", + "test": "cross-env TZ=UTC NODE_ENV=development jest --runInBand --forceExit --detectOpenHandles", "dev": "cross-env TZ=UTC nodemon -w src --ext ts --exec ts-node -r dotenv/config -r tsconfig-paths/register src/index.ts", "lint": "eslint --max-warnings=0 --ext .js,.ts ." }, diff --git a/frontend/jest.config.js b/frontend/jest.config.js index a32330f3b..023fd64fd 100644 --- a/frontend/jest.config.js +++ b/frontend/jest.config.js @@ -1,13 +1,18 @@ module.exports = { verbose: true, + collectCoverage: true, collectCoverageFrom: ['src/**/*.{js,vue}', '!**/node_modules/**', '!**/?(*.)+(spec|test).js?(x)'], + coverageThreshold: { + global: { + lines: 95, + }, + }, moduleFileExtensions: [ 'js', // 'jsx', 'json', 'vue', ], - // coverageReporters: ['lcov', 'text'], moduleNameMapper: { '\\.(css|less)$': 'identity-obj-proxy', '\\.(scss)$': '/src/assets/mocks/styleMock.js', diff --git a/frontend/package.json b/frontend/package.json index 865ba060f..513b6b509 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -10,7 +10,7 @@ "analyse-bundle": "yarn build && webpack-bundle-analyzer dist/webpack.stats.json", "lint": "eslint --max-warnings=0 --ext .js,.vue,.json .", "stylelint": "stylelint --max-warnings=0 '**/*.{scss,vue}'", - "test": "cross-env TZ=UTC jest --coverage", + "test": "cross-env TZ=UTC jest", "locales": "scripts/sort.sh" }, "dependencies": { diff --git a/frontend/src/components/Menu/Sidebar.spec.js b/frontend/src/components/Menu/Sidebar.spec.js index 321d73a3a..e6e4cfe2a 100644 --- a/frontend/src/components/Menu/Sidebar.spec.js +++ b/frontend/src/components/Menu/Sidebar.spec.js @@ -49,15 +49,15 @@ describe('Sidebar', () => { expect(wrapper.findAll('.nav-item').at(2).text()).toEqual('navigation.transactions') }) - it('has nav-item "gdt.gdt" in navbar', () => { + it('has nav-item "creation" in navbar', () => { expect(wrapper.findAll('.nav-item').at(3).text()).toEqual('creation') }) - it('has nav-item "creation" in navbar', () => { + it('has nav-item "GDT" in navbar', () => { expect(wrapper.findAll('.nav-item').at(4).text()).toContain('GDT') }) - it('has nav-item "Information" in navbar', () => { + it('has nav-item "navigation.info" in navbar', () => { expect(wrapper.findAll('.nav-item').at(5).text()).toContain('navigation.info') }) }) @@ -68,13 +68,13 @@ describe('Sidebar', () => { expect(wrapper.findAll('ul').at(1).findAll('.nav-item')).toHaveLength(2) }) - it('has nav-item "navigation.info" in navbar', () => { + it('has nav-item "navigation.settings" in navbar', () => { expect(wrapper.findAll('ul').at(1).findAll('.nav-item').at(0).text()).toEqual( 'navigation.settings', ) }) - it('has nav-item "navigation.settings" in navbar', () => { + it('has nav-item "navigation.logout" in navbar', () => { expect(wrapper.findAll('ul').at(1).findAll('.nav-item').at(1).text()).toEqual( 'navigation.logout', ) diff --git a/frontend/src/components/Menu/Sidebar.vue b/frontend/src/components/Menu/Sidebar.vue index 83adcb594..644fb37e0 100644 --- a/frontend/src/components/Menu/Sidebar.vue +++ b/frontend/src/components/Menu/Sidebar.vue @@ -48,7 +48,12 @@ {{ $t('navigation.admin_area') }} - + {{ $t('navigation.logout') }}