diff --git a/test/unit/specs/components/attributeTable/AttributeTableWin.spec.js b/test/unit/specs/components/attributeTable/AttributeTableWin.spec.js deleted file mode 100644 index c16283b8..00000000 --- a/test/unit/specs/components/attributeTable/AttributeTableWin.spec.js +++ /dev/null @@ -1,55 +0,0 @@ -import Vue from 'vue'; -import AttributeTableWin from '@/components/attributeTable/AttributeTableWin' -import { expect } from 'chai'; -import { shallowMount } from '@vue/test-utils'; - -const appConfig = { modules: { 'wgu-attributetable': {} } }; - -describe('attributeTable/AttributeTableWin.vue', () => { - it('is defined', () => { - expect(typeof AttributeTableWin).to.not.equal('undefined'); - }); - - describe('props', () => { - let comp; - beforeEach(() => { - Vue.prototype.$appConfig = appConfig; - comp = shallowMount(AttributeTableWin); - }); - - it('has correct default props', () => { - expect(comp.vm.icon).to.equal('table_chart'); - }); - - afterEach(() => { - comp.destroy(); - Vue.prototype.$appConfig = undefined; - }); - }); - - // Evaluate the results of functions in - // the raw component options - it('sets the correct default data', () => { - expect(AttributeTableWin.data).to.be.a('function'); - const defaultData = AttributeTableWin.data(); - expect(defaultData).to.be.an('object'); - - expect(defaultData.layers).to.be.an('array'); - expect(defaultData.layers.length).to.eql(0); - expect(defaultData.selLayer).to.be.null; - }); - - describe('methods', () => { - let comp; - let vm; - beforeEach(() => { - Vue.prototype.$appConfig = appConfig; - comp = shallowMount(AttributeTableWin); - vm = comp.vm; - }); - - it('are implemented', () => { - expect(vm.onMapBound).to.be.a('function'); - }); - }); -}); diff --git a/test/unit/specs/components/modulecore/ModuleCard.spec.js b/test/unit/specs/components/modulecore/ModuleCard.spec.js deleted file mode 100644 index c097473b..00000000 --- a/test/unit/specs/components/modulecore/ModuleCard.spec.js +++ /dev/null @@ -1,89 +0,0 @@ -import ModuleCard from '@/components/modulecore/ModuleCard' -import { shallowMount } from '@vue/test-utils'; - -const moduleProps = { - moduleName: 'my-module', - icon: 'my-icon', - win: 'floating' -} - -describe('modulecore/ModuleCard.vue', () => { - it('is defined', () => { - expect(ModuleCard).to.not.be.an('undefined'); - }); - - it('has a created hook', () => { - expect(ModuleCard.created).to.be.a('function'); - }); - - describe('props', () => { - let comp; - beforeEach(() => { - comp = shallowMount(ModuleCard, { - propsData: moduleProps - }); - }); - - it('has correct default props', () => { - expect(comp.vm.minimizable).to.equal(false); - expect(comp.vm.closable).to.equal(true); - expect(comp.vm.backgroundImage).to.be.undefined; - expect(comp.vm.draggable).to.equal(true); - expect(comp.vm.visible).to.equal(false); - expect(comp.vm.initPos).to.be.an('undefined'); - expect(comp.vm.height).to.be.an('undefined'); - expect(comp.vm.width).to.be.an('undefined'); - expect(comp.vm.maxHeight).to.be.an('undefined'); - expect(comp.vm.maxWidth).to.be.an('undefined'); - expect(comp.vm.minHeight).to.be.an('undefined'); - expect(comp.vm.minWidth).to.be.an('undefined'); - }); - - it('has correct props', () => { - expect(comp.vm.moduleName).to.equal('my-module'); - expect(comp.vm.icon).to.equal('my-icon'); - expect(comp.vm.win).to.equal('floating'); - }); - - afterEach(() => { - comp.destroy(); - }); - }); - - describe('data', () => { - let comp; - beforeEach(() => { - comp = shallowMount(ModuleCard, { - propsData: moduleProps - }); - }); - - it('has correct default data', () => { - expect(comp.vm.show).to.equal(false); - expect(comp.vm.minimized).to.equal(false); - }); - - afterEach(() => { - comp.destroy(); - }); - }); - - describe('methods', () => { - let comp; - beforeEach(() => { - comp = shallowMount(ModuleCard, { - propsData: moduleProps - }); - }); - - it('toggleUi switches show', () => { - comp.vm.show = false; - comp.vm.toggleUi(); - expect(comp.vm.show).to.equal(true); - }); - - afterEach(() => { - comp.destroy(); - }); - }); -}); diff --git a/upgrade-notes.md b/upgrade-notes.md index 2de39e4b..d59d922a 100644 --- a/upgrade-notes.md +++ b/upgrade-notes.md @@ -2,6 +2,25 @@ ## v1 -> v2 +### Vue-CLI + +This lists some essentials, which had to be adapted in the Wegue code regarding to the upgrade to Vue-CLI in version 5.0.7: + +- The command used to run the dev build is now `npm run serve`. +- Some new config files are present in the root directory. Take particular attention to `vue.config.js` used to configure the build process and `jsconfig.json` to configure `IDEs` integration. +- The main `HTML` template files which were present in the root directory are now in a `public` subfolder. Please adapt them to the needs of your Wegue application. +- The build configuration which was previously made inside the `build` and `config` directories should be placed in the `vue.config.js` file. Please adapt it to the needs of your Wegue application. +The original `build` and `config` directories can be removed once this is done. +- Environment variables defined inside the `.env.js` files inside the `config` directory should be placed in `.env` files in the root directory. +`dev.env.js` should now be called `.env.development`, `prod.env.js` should now be called `.env.production` and `test.env.js` should now be called `.env.test`. +Please note than only `NODE_ENV`, `BASE_URL` and variables that start with `VUE_APP_` will be statically embedded into the client bundle. Please rename your variables in your Wegue application in case you use them after the build process. + +Please refer to the official [Vue-CLI Guide](https://cli.vuejs.org/guide/) and [vue.config.js reference](https://cli.vuejs.org/config/#vue-config-js) when you upgrade your Wegue app. + +If you're using environment variables inside your Wegue app, please read [Vue-CLI's Modes and Environment Variables Guide](https://cli.vuejs.org/guide/mode-and-env.html) carefully before updating your app. + +`Vue-CLI` uses `Webpack 5` and `webpack-chain 6.5.1` under the hood. Please refer to [Vue-CLI's Working with Webpack guide](https://cli.vuejs.org/guide/webpack.html), [Webpack configuration guide](https://webpack.js.org/configuration/) and [webpack-chain documentation](https://github.com/neutrinojs/webpack-chain/tree/v6.5.1) if advanced configuration is needed inside your Wegue app. + ### OpenLayers This lists some essentials, which had to be adapted in the Wegue code regarding to the upgrade to OpenLayers in version 7: @@ -26,3 +45,17 @@ The MDI icon libraries used were upgraded to the following versions: - `material-icons` => 1.13.x Please refer to the [official changelog](https://pictogrammers.com/docs/library/mdi/releases/changelog/) for versions later than `5.9.55` and check if you are using `removed` or `renamed` icons. Those have to be adapted and/or replaced in your Wegue application. + +### ESLint + +ESLint and its associated plugins were upgraded to the following versions: + +- `eslint` => 7.32.x +- `eslint-plugin-standard` => 4.1.x +- `eslint-plugin-vue` => 7.20.x +- `eslint-config-standard` => 16.0.x +- `@vue/eslint-config-standard` => 6.1.x + +As lots of new linting rules were added, you should expect to see error and warnings the first time you will build your updated Wegue app. +The majority of those can be fixed automatically by running the `npm run lint:fix` command. +If you want to momentarily bypass some advanced errors to test your upgraded app or want to adapt linting rules to better suit your preferences, you can modify the `.eslintrc.js` file as needed.