From 9f8bad1ffa0ef596eacd5531aad1099f220241bf Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Thu, 5 Dec 2019 03:58:54 +0100 Subject: [PATCH] Frontend: Code & test clean-up Signed-off-by: Michael Mayer --- Makefile | 11 ++++++----- frontend/karma.conf.js | 3 ++- frontend/package.json | 4 ++-- frontend/src/component/p-navigation.vue | 2 +- .../src/pages/{albums/view.vue => album/photos.vue} | 4 ++-- frontend/src/pages/albums.vue | 2 +- frontend/src/routes.js | 6 +++--- 7 files changed, 17 insertions(+), 15 deletions(-) rename frontend/src/pages/{albums/view.vue => album/photos.vue} (98%) diff --git a/Makefile b/Makefile index f063d5e45..680201cce 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,8 @@ dep: dep-tensorflow dep-js dep-go build: build-js build-go install: install-bin install-assets test: test-js test-go -acceptance: start test-chromium test-firefox stop +acceptance-all: start acceptance acceptance-firefox stop +test-all: test acceptance-all fmt: fmt-js fmt-go upgrade: upgrade-js upgrade-go start: @@ -63,12 +64,12 @@ watch-js: test-js: $(info Running JS unit tests...) (cd frontend && env NODE_ENV=development BABEL_ENV=test npm run test) -test-chromium: +acceptance: $(info Running JS acceptance tests in Chrome...) - (cd frontend && npm run test-chromium) -test-firefox: + (cd frontend && npm run acceptance) +acceptance-firefox: $(info Running JS acceptance tests in Firefox...) - (cd frontend && npm run test-firefox) + (cd frontend && npm run acceptance-firefox) test-go: $(info Running all Go unit tests...) $(GOTEST) -count=1 -tags=slow -timeout 20m ./internal/... diff --git a/frontend/karma.conf.js b/frontend/karma.conf.js index 9d5d02b45..397158de6 100644 --- a/frontend/karma.conf.js +++ b/frontend/karma.conf.js @@ -5,7 +5,7 @@ process.env.CHROME_BIN = findChrome(); module.exports = (config) => { config.set({ - logLevel: config.LOG_INFO, + logLevel: config.LOG_ERROR, webpackMiddleware: { stats: "errors-only", @@ -24,6 +24,7 @@ module.exports = (config) => { files: [ {pattern: "tests/unit/**/*_test.js", watched: false}, + 'node_modules/@babel/polyfill/dist/polyfill.js', ], // Preprocess through webpack diff --git a/frontend/package.json b/frontend/package.json index 1f7a90ade..f42ccfca0 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -10,8 +10,8 @@ "lint": "eslint --cache src/ *.js", "fmt": "eslint --cache --fix src/ *.js", "test": "karma start", - "test-chromium": "testcafe \"chromium:headless --disable-dev-shm-usage\" --selector-timeout 5000 -S -s tests/screenshots tests/acceptance", - "test-firefox": "testcafe firefox:headless --selector-timeout 5000 -S -s tests/screenshots tests/acceptance", + "acceptance": "testcafe \"chromium:headless --disable-dev-shm-usage\" --selector-timeout 5000 -S -s tests/screenshots tests/acceptance", + "acceptance-firefox": "testcafe firefox:headless --selector-timeout 5000 -S -s tests/screenshots tests/acceptance", "gettext-extract": "gettext-extract --attribute v-translate --output src/resources/translations.pot $(find src/ -type f -name '*.vue')", "gettext-compile": "gettext-compile --output src/resources/translations.json src/resources/*.po" }, diff --git a/frontend/src/component/p-navigation.vue b/frontend/src/component/p-navigation.vue index 9384fe2ba..811e21fe5 100644 --- a/frontend/src/component/p-navigation.vue +++ b/frontend/src/component/p-navigation.vue @@ -90,7 +90,7 @@ + :key="index" :to="{ name: 'album', params: { uuid: album.AlbumUUID, slug: album.AlbumSlug } }"> {{ album.AlbumName }} Untitled diff --git a/frontend/src/pages/albums/view.vue b/frontend/src/pages/album/photos.vue similarity index 98% rename from frontend/src/pages/albums/view.vue rename to frontend/src/pages/album/photos.vue index ad473f537..6225f49d2 100644 --- a/frontend/src/pages/albums/view.vue +++ b/frontend/src/pages/album/photos.vue @@ -1,5 +1,5 @@