Compare commits

...

23 Commits

Author SHA1 Message Date
c406c11b88 Commits After Part 1 2020-08-01 14:21:29 -07:00
The Jared Wilcurt
083b450fd3
Update App.test.js.snap 2020-07-24 12:08:57 -04:00
The Jared Wilcurt
105bfa6b66
Rename vue.png to logo.png
This prevents a bug from when you `vue add vue-router`
2020-07-24 10:56:44 -04:00
TheJaredWilcurt
c4a9410e76 Rename vue.png to logo.png
This prevents a bug from when you vue add vue-router
2020-07-24 10:53:50 -04:00
The Jared Wilcurt
0c6fad9828
Rename vue.png to logo.png 2020-07-24 10:44:55 -04:00
The Jared Wilcurt
512a079698
Update package.json 2020-07-16 14:06:11 -04:00
The Jared Wilcurt
0a75ba489a
Update dependencies
* Fix Jest Haste Map
* Update NW.js
* Swap Vue-A11y linter for Vuejs-Accessibility
* Lint
* Update deps
* Remove --runInBand
* Bump to 1.6.0
2020-07-16 13:57:21 -04:00
TheJaredWilcurt
de49954d58 Bump to 1.6.0 2020-07-16 13:37:30 -04:00
TheJaredWilcurt
c5d8775d93 Remove --runInBand 2020-07-16 13:37:17 -04:00
TheJaredWilcurt
e4f83505e0 Update deps 2020-07-16 13:37:01 -04:00
TheJaredWilcurt
2d8aa8b6c7 Lint 2020-07-16 13:36:14 -04:00
TheJaredWilcurt
f3f430ab47 Swap Vue-A11y linter for Vuejs-Accessibility 2020-07-16 13:36:02 -04:00
TheJaredWilcurt
f63522dcf1 Update NW.js 2020-07-16 13:34:54 -04:00
TheJaredWilcurt
3ae1535348 Fix Jest Haste Map 2020-07-16 13:33:30 -04:00
The Jared Wilcurt
812c3a1edd
Update dependencies 2020-02-19 12:49:31 -05:00
TheJaredWilcurt
079f0399fc bump 2020-02-19 12:09:32 -05:00
TheJaredWilcurt
f8d5c7c4f9 remove note 2020-02-19 12:02:57 -05:00
TheJaredWilcurt
e35a2b69fa Updating to Vue-CLI 4.2.2 2020-02-19 12:01:02 -05:00
TheJaredWilcurt
58d0251849 Updating non-vue deps 2020-02-19 12:00:43 -05:00
TheJaredWilcurt
e7c99dade0 Update NW.js 2020-02-19 12:00:03 -05:00
TheJaredWilcurt
ec2853f2b6 fix tests 2020-02-19 11:34:27 -05:00
TheJaredWilcurt
0cbdf6b8a1 Revert to Jest 24.9.0 to avoid bug 2020-02-19 11:19:59 -05:00
The Jared Wilcurt
0a009067ae Update dependencies 2020-01-23 19:43:40 -05:00
23 changed files with 4440 additions and 10370 deletions

View File

@ -1 +1 @@
chrome 79 chrome 84

View File

@ -26,7 +26,7 @@ module.exports = {
extends: [ extends: [
'eslint:recommended', 'eslint:recommended',
'plugin:jest/recommended', 'plugin:jest/recommended',
'plugin:vue-a11y/recommended', 'plugin:vuejs-accessibility/recommended',
'tjw-base', 'tjw-base',
'tjw-vue' 'tjw-vue'
], ],
@ -35,7 +35,15 @@ module.exports = {
'error', 'error',
'Property[method="true"]' 'Property[method="true"]'
], ],
// https://github.com/maranran/eslint-plugin-vue-a11y/issues/10 'vuejs-accessibility/label-has-for': [
'vue-a11y/click-events-have-key-events': 'off' 'error',
{
'components': ['Label'],
'required': {
'some': ['nesting', 'id']
},
'allowChildren': false
}
]
} }
}; };

View File

@ -6,9 +6,11 @@ NW.js + Vue-CLI 4 example
![A screenshot of the default app running on Windows](screenshot.png) ![A screenshot of the default app running on Windows](screenshot.png)
* NW.js * NW.js 0.47.0
* Vue-CLI 4 * Chrome 84
* Vue 2.6 * Node 14.5.0
* Vue-CLI 4.4.6
* Vue 2.6.11
* Vue-DevTools (latest) * Vue-DevTools (latest)
* Babel * Babel
* ESLint * ESLint
@ -88,5 +90,6 @@ This is not for those *using* this repo, but for those *maintaining* it.
* `tests/unit/setup.js` * `tests/unit/setup.js`
* `tests/unit/components/__snapshots__/HelloWorld.test.js.snap` * `tests/unit/components/__snapshots__/HelloWorld.test.js.snap`
* `.browserslistrc` * `.browserslistrc`
1. Update the version numbers at the top of the README
1. Bump the version number, and all the npm scripts that reference the version number 1. Bump the version number, and all the npm scripts that reference the version number
1. Run `npm run regression` after updating dependencies or other major changes to verify builds still work correctly 1. Run `npm run regression` after updating dependencies or other major changes to verify builds still work correctly

View File

@ -1,5 +1,5 @@
module.exports = { module.exports = {
presets: [ presets: [
'@vue/app' '@vue/cli-plugin-babel/preset'
] ]
}; };

View File

@ -2,45 +2,20 @@ process.env.VUE_CLI_BABEL_TARGET_NODE = true;
process.env.VUE_CLI_BABEL_TRANSPILE_MODULES = true; process.env.VUE_CLI_BABEL_TRANSPILE_MODULES = true;
module.exports = { module.exports = {
collectCoverageFrom: [ preset: '@vue/cli-plugin-unit-jest',
'src/**/*.{js,vue}',
'!src/main.js',
'!**/node_modules/**'
],
coverageDirectory: '<rootDir>/tests/unit/coverage', coverageDirectory: '<rootDir>/tests/unit/coverage',
moduleFileExtensions: [
'js',
'jsx',
'json',
'vue'
],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
},
setupFilesAfterEnv: [ setupFilesAfterEnv: [
'<rootDir>/tests/unit/setup.js' '<rootDir>/tests/unit/setup.js'
], ],
snapshotSerializers: [ snapshotSerializers: [
'<rootDir>/node_modules/jest-serializer-vue-tjw' '<rootDir>/node_modules/jest-serializer-vue-tjw'
], ],
testEnvironment: 'jest-environment-jsdom-global',
testMatch: [ testMatch: [
'**/tests/unit/**/*.test.js' '**/tests/unit/**/*.test.js'
], ],
testPathIgnorePatterns: [ testPathIgnorePatterns: [
'<rootDir>/tests/e2e' '<rootDir>/tests/e2e',
], '<rootDir>/dist',
testURL: 'http://localhost/', '<rootDir>/dist-vue'
transform: {
'^.+\\.vue$': 'vue-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
'^.+\\.jsx?$': 'babel-jest'
},
transformIgnorePatterns: [
'/node_modules/'
],
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname'
] ]
}; };

View File

@ -15,6 +15,7 @@ nwBinary = './node_modules/nw/' + nwBinary;
driver = './node_modules/nw/' + driver; driver = './node_modules/nw/' + driver;
module.exports = (function (settings) { module.exports = (function (settings) {
console.log(nwBinary);
settings.webdriver.server_path = driver; settings.webdriver.server_path = driver;
settings.selenium.cli_args['webdriver.chrome.driver'] = driver; settings.selenium.cli_args['webdriver.chrome.driver'] = driver;
return settings; return settings;

14277
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,89 +1,75 @@
{ {
"name": "nw-vue",
"version": "1.6.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --port=8964",
"build": "npm run build:clean && npm run build:vue && npm run build:nw",
"test:unit": "jest --config jest.config.js --coverage",
"test:e2e": "vue-cli-service test:e2e",
"lint": "vue-cli-service lint --no-fix",
"build:clean": "rimraf ./dist-vue ./dist",
"build:lin": "npm run build:lin:clean && npm run build:vue && build --tasks linux-x64 --mirror https://dl.nwjs.io/ .",
"build:lin:clean": "rimraf ./dist-vue ./dist/nw-vue-1.6.0-linux-x64 ./dist/nw-vue-1.6.0-linux-x64.zip",
"build:nw": "build --concurrent --tasks win-x86,linux-x86,linux-x64,mac-x64 --mirror https://dl.nwjs.io/ .",
"build:vue": "vue-cli-service build --modern --dest ./dist-vue",
"build:win": "npm run build:win:clean && npm run build:vue && build --tasks win-x86 --mirror https://dl.nwjs.io/ .",
"build:win:clean": "rimraf ./dist-vue ./dist/nw-vue-1.6.0-win-x86 ./dist/nw-vue-1.6.0-win-x86.zip ./dist/nw-vue-1.6.0-win-x86.7z ./dist/nw-vue-1.6.0-win-x86-Setup.exe",
"fix": "vue-cli-service lint --fix",
"regression": "rd /s /q node_modules & rd /s /q node_modules & rd /s /q node_modules & npm install && npm run lint && npm test && npm run build:win && npm run run:win",
"run:lin": "./dist/nw-vue-1.6.0-linux-x64/nw-vue",
"run:win": "dist\\nw-vue-1.6.0-win-x86\\nw-vue.exe",
"start": "concurrently \"npm run serve\" \"wait-on http://localhost:8964 && nw .\"",
"test": "npm run test:unit",
"update:vue-devtools": "rimraf ./node_modules/nw-vue-devtools-prebuilt && npm install",
"validate": "npm run lint && npm run test:unit && npm run build:vue"
},
"main": "http://localhost:8964",
"dependencies": {
"bootstrap": "^4.5.0",
"bootstrap-vue": "^2.16.0",
"express": "^4.17.1",
"vue-router": "^3.2.0",
"vue-select": "^3.10.7",
"vue2-datepicker": "^3.6.1",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.4.6",
"@vue/cli-plugin-e2e-nightwatch": "^4.4.6",
"@vue/cli-plugin-eslint": "^4.4.6",
"@vue/cli-plugin-router": "^4.4.6",
"@vue/cli-plugin-unit-jest": "^4.4.6",
"@vue/cli-plugin-vuex": "^4.4.6",
"@vue/cli-service": "^4.4.6",
"@vue/test-utils": "^1.0.3",
"babel-eslint": "^10.1.0",
"concurrently": "^5.2.0",
"core-js": "^3.6.5",
"eslint": "^7.4.0",
"eslint-config-tjw-base": "^1.0.0",
"eslint-config-tjw-vue": "^2.0.0",
"eslint-plugin-jest": "^23.18.0",
"eslint-plugin-vue": "^6.2.2",
"eslint-plugin-vuejs-accessibility": "^0.3.1",
"jest-serializer-vue-tjw": "^3.14.0",
"nw": "0.47.0-sdk",
"nw-vue-devtools-prebuilt": "^0.0.10",
"nwjs-builder-phoenix": "^1.15.0",
"nwjs-types": "^1.0.0",
"rimraf": "^3.0.2",
"vue": "^2.6.11",
"vue-template-compiler": "^2.6.11",
"wait-on": "^5.1.0"
},
"ManifestComments": [ "ManifestComments": [
"Only add dependencies that you want shipped to the end user, for everything else, use devDependencies, including things that will be bundled by webpack.", "Only add dependencies that you want shipped to the end user, for everything else, use devDependencies, including things that will be bundled by webpack.",
"NW.js requires a name and a main, everything else is optional.", "NW.js requires a name and a main, everything else is optional.",
"The build section is used by nwjs-builder-phoenix, see its documentation for more info", "The build section is used by nwjs-builder-phoenix, see its documentation for more info",
"To turn spell checking off, remove it from the chromium-args in this file" "To turn spell checking off, remove it from the chromium-args in this file"
], ],
"name": "nw-vue",
"version": "1.4.0",
"main": "http://localhost:8964",
"node-remote": "http://localhost:8964",
"node-main": "",
"window": {
"width": 960,
"height": 600,
"min_width": 700,
"min_height": 500,
"icon": "src/assets/vue.png"
},
"private": true,
"scripts": {
"start": "concurrently \"npm run serve\" \"wait-on http://localhost:8964 && nw .\"",
"serve": "vue-cli-service serve --port=8964",
"build": "npm run build:clean && npm run build:vue && npm run build:nw",
"build:clean": "rimraf ./dist-vue ./dist",
"build:vue": "vue-cli-service build --modern --dest ./dist-vue",
"build:nw": "build --concurrent --tasks win-x86,linux-x86,linux-x64,mac-x64 --mirror https://dl.nwjs.io/ .",
"build:win": "npm run build:win:clean && npm run build:vue && build --tasks win-x86 --mirror https://dl.nwjs.io/ .",
"build:lin": "npm run build:lin:clean && npm run build:vue && build --tasks linux-x64 --mirror https://dl.nwjs.io/ .",
"build:win:clean": "rimraf ./dist-vue ./dist/nw-vue-1.4.0-win-x86 ./dist/nw-vue-1.4.0-win-x86.zip ./dist/nw-vue-1.4.0-win-x86.7z ./dist/nw-vue-1.4.0-win-x86-Setup.exe",
"build:lin:clean": "rimraf ./dist-vue ./dist/nw-vue-1.4.0-linux-x64 ./dist/nw-vue-1.4.0-linux-x64.zip",
"run:win": "dist\\nw-vue-1.4.0-win-x86\\nw-vue.exe",
"run:lin": "./dist/nw-vue-1.4.0-linux-x64/nw-vue",
"regression": "rd /s /q node_modules & rd /s /q node_modules & rd /s /q node_modules & npm install && npm run lint && npm test && npm run build:win && npm run run:win",
"lint": "vue-cli-service lint --no-fix",
"fix": "vue-cli-service lint --fix",
"test": "npm run test:unit",
"test:e2e": "vue-cli-service test:e2e",
"test:unit": "jest --config jest.config.js --coverage --runInBand",
"validate": "npm run lint && npm run test:unit && npm run build:vue",
"update:vue-devtools": "rimraf ./node_modules/nw-vue-devtools-prebuilt && npm install"
},
"dependencies": {
"express": "^4.17.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.2",
"@vue/cli-plugin-e2e-nightwatch": "^4.1.2",
"@vue/cli-plugin-eslint": "^4.1.2",
"@vue/cli-plugin-unit-jest": "^4.1.2",
"@vue/cli-service": "^4.1.2",
"@vue/test-utils": "1.0.0-beta.29",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-plugin-dynamic-import-node": "^2.3.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.7.0",
"babel-preset-stage-2": "^6.24.1",
"babel-preset-vue-app": "^2.0.0",
"concurrently": "^5.0.2",
"core-js": "^3.6.4",
"eslint": "^6.8.0",
"eslint-config-tjw-base": "^1.0.0",
"eslint-config-tjw-vue": "^1.0.0",
"eslint-plugin-jest": "^23.6.0",
"eslint-plugin-vue": "^6.1.2",
"eslint-plugin-vue-a11y": "^0.0.31",
"jest": "^24.9.0",
"jest-environment-jsdom": "^24.9.0",
"jest-environment-jsdom-global": "^1.2.0",
"jest-serializer-vue-tjw": "^3.3.0",
"jest-transform-stub": "^2.0.0",
"nw": "0.43.6-sdk",
"nw-vue-devtools-prebuilt": "^0.0.10",
"nwjs-builder-phoenix": "^1.15.0",
"nwjs-types": "^1.0.0",
"rimraf": "^3.0.0",
"vue": "^2.6.11",
"vue-jest": "^3.0.5",
"vue-template-compiler": "^2.6.11",
"wait-on": "^4.0.0"
},
"chromium-args": "--enable-spell-checking --load-extension='./node_modules/nw-vue-devtools-prebuilt/extension'",
"build": { "build": {
"nwVersion": "v0.43.6", "nwVersion": "v0.47.0",
"nwFlavor": "normal", "nwFlavor": "normal",
"targets": [ "targets": [
"zip", "zip",
@ -150,5 +136,15 @@
"diffUpdaters": false, "diffUpdaters": false,
"hashCalculation": true "hashCalculation": true
} }
},
"chromium-args": "--enable-spell-checking --load-extension='./node_modules/nw-vue-devtools-prebuilt/extension'",
"node-main": "",
"node-remote": "http://localhost:8964",
"window": {
"width": 960,
"height": 600,
"min_width": 700,
"min_height": 500,
"icon": "src/assets/vue.png"
} }
} }

View File

@ -1,41 +1,55 @@
<template> <template>
<div id="app"> <div id="app">
<img <b-navbar toggleable="lg" type="dark" variant="info">
src="@/assets/vue.png" <b-button class="mr-4" v-b-toggle.sidebar>Menu</b-button>
alt="Vue.js logo" <b-navbar-brand href="#">NavBar</b-navbar-brand>
title="Vue.js" </b-navbar>
class="logo" <b-sidebar id="sidebar" title="Main Menu">
/> <div class="px-3 py-2">
<img <b-list-group>
src="@/assets/nw.png" <b-list-group-item href="/#/">
alt="NW.js logo" Hours Log
title="NW.js" </b-list-group-item>
class="logo" <b-list-group-item href="/#/projects">
/> Projects
<HelloWorld msg="Welcome to your Vue.js Desktop App in NW.js!" /> </b-list-group-item>
</b-list-group>
<div class="dropdown-divider"></div>
<b-list-group class="">
<b-list-group-item href="/">
Exports
</b-list-group-item>
<b-list-group-item href="/">
Settings
</b-list-group-item>
</b-list-group>
</div>
</b-sidebar>
<div id="nav">
</div>
<router-view />
</div> </div>
</template> </template>
<script>
import HelloWorld from '@/components/HelloWorld.vue';
export default {
name: 'App',
components: {
HelloWorld
}
};
</script>
<style> <style>
#app { #app {
margin-top: 60px; font-family: Avenir, Helvetica, Arial, sans-serif;
color: #2C3E50; -webkit-font-smoothing: antialiased;
font-family: 'Avenir', sans-serif; -moz-osx-font-smoothing: grayscale;
text-align: center; text-align: center;
color: #2c3e50;
} }
.logo {
max-height: 140px; #nav {
margin: 0px 10px; padding: 30px;
}
#nav a {
font-weight: bold;
color: #2c3e50;
}
#nav a.router-link-exact-active {
color: #42b983;
} }
</style> </style>

View File

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -1,10 +1,29 @@
import Vue from 'vue'; import Vue from 'vue';
import { BootstrapVue, IconsPlugin } from 'bootstrap-vue'
import vSelect from 'vue-select'
import DatePicker from 'vue2-datepicker'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
import 'vue-select/dist/vue-select.css'
import 'vue2-datepicker/index.css'
import App from './App.vue'; import App from './App.vue';
import router from './router';
import store from './store';
Vue.use(BootstrapVue)
Vue.use(IconsPlugin)
Vue.component('v-select', vSelect)
Vue.component('date-picker', DatePicker)
Vue.config.productionTip = false; Vue.config.productionTip = false;
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
const app = new Vue({ const app = new Vue({
router,
store,
render: function (hyperscript) { render: function (hyperscript) {
return hyperscript(App); return hyperscript(App);
} }

31
src/router/index.js Normal file
View File

@ -0,0 +1,31 @@
import Vue from 'vue';
import VueRouter from 'vue-router';
import HoursLog from '../views/HoursLog.vue';
import TimeEntry from '../views/TimeEntry.vue';
import Projects from '../views/Projects.vue'
Vue.use(VueRouter);
const routes = [
{
path: '/',
name: 'HoursLog',
component: HoursLog
},
{
path: '/add-time-entry',
name: 'TimeEntry',
component: TimeEntry
},
{
path: '/projects',
name: 'Projects',
component: Projects
},
];
const router = new VueRouter({
routes
});
export default router;

15
src/store/index.js Normal file
View File

@ -0,0 +1,15 @@
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
export default new Vuex.Store({
state: {
},
mutations: {
},
actions: {
},
modules: {
}
});

46
src/views/HoursLog.vue Normal file
View File

@ -0,0 +1,46 @@
<template>
<b-container class="hours-log-page">
<b-row>
<b-col cm="8" offset-sm="2">
<b-row class="mt-5 mb-4 ">
<b-col>
<h1>Hours Log</h1>
</b-col>
<b-col>
<b-btn variant="primary" @click="$router.push({name: 'TimeEntry'})">
+ Add Entry
</b-btn>
</b-col>
</b-row>
<b-row>
<b-col>
<b-table striped hover :items="items"></b-table>
</b-col>
</b-row>
</b-col>
</b-row>
</b-container>
</template>
<script>
// @ is an alias to /src
export default {
name: 'HoursLog',
components: {
},
data() {
return {
items: [
{
project_name: 'Company #1',
date: 'May 12, 2020',
start_time: '7:00 am',
end_time: '11:00',
},
]
}
}
};
</script>

39
src/views/Projects.vue Normal file
View File

@ -0,0 +1,39 @@
<template>
<b-container class="projects-page">
<b-row>
<b-col cm="8" offset-sm="2">
<b-row class="mt-5 mb-4 ">
<b-col>
<h1>Projects</h1>
</b-col>
<b-col>
<b-btn variant="primary">+ Add New Project</b-btn>
</b-col>
</b-row>
<b-row>
<b-col>
<v-select
:options="[{label: 'Canada', code: 'ca'}]"
/>
</b-col>
</b-row>
</b-col>
</b-row>
</b-container>
</template>
<script>
// @ is an alias to /src
export default {
name: 'Projects',
components: {
},
data() {
return {
}
}
};
</script>

56
src/views/TimeEntry.vue Normal file
View File

@ -0,0 +1,56 @@
<template>
<b-container class="time-entry-page">
<b-row>
<b-col sm="6" offset-sm="3">
<b-row>
<b-col>
<h1>New Time Entry</h1>
</b-col>
</b-row>
<b-row>
<b-col>
<b-form @submit="onSubmit" @reset="onReset">
<b-form-group id="input-group-1" label="Star Date:" label-for="input-1">
<date-picker v-model="formData.startDate" type="datetime" />
</b-form-group>
<b-form-group id="input-group-2" label="End Date:" label-for="input-2">
<date-picker v-model="formData.endDate" type="datetime" />
</b-form-group>
<b-button type="submit" variant="primary">Submit</b-button>
<b-button type="reset" variant="danger">Reset</b-button>
</b-form>
</b-col>
</b-row>
</b-col>
</b-row>
</b-container>
</template>
<script>
// @ is an alias to /src
export default {
name: 'TimeEntry',
components: {
},
data() {
return {
formData: {
startDate: {},
endDate: {},
notes: '',
}
}
},
methods: {
onSubmit() {
},
onReset() {
},
},
};
</script>

View File

@ -5,7 +5,7 @@ describe('App.vue', () => {
test('Render default contents', () => { test('Render default contents', () => {
const wrapper = shallowMount(App); const wrapper = shallowMount(App);
expect(wrapper.html()) expect(wrapper)
.toMatchSnapshot(); .toMatchSnapshot();
}); });
}); });

View File

@ -2,7 +2,7 @@
exports[`App.vue Render default contents 1`] = ` exports[`App.vue Render default contents 1`] = `
<div id="app"> <div id="app">
<img src="@/assets/vue.png" alt="Vue.js logo" title="Vue.js" class="logo"> <img src="@/assets/logo.png" alt="Vue.js logo" title="Vue.js" class="logo">
<img src="@/assets/nw.png" alt="NW.js logo" title="NW.js" class="logo"> <img src="@/assets/nw.png" alt="NW.js logo" title="NW.js" class="logo">
<helloworld-stub msg="Welcome to your Vue.js Desktop App in NW.js!"></helloworld-stub> <helloworld-stub msg="Welcome to your Vue.js Desktop App in NW.js!"></helloworld-stub>
</div> </div>

View File

@ -5,23 +5,25 @@ describe('FsExample.vue', () => {
test('Render default contents', () => { test('Render default contents', () => {
const wrapper = shallowMount(FsExample); const wrapper = shallowMount(FsExample);
expect(wrapper.html()) expect(wrapper)
.toMatchSnapshot(); .toMatchSnapshot();
}); });
test('Click button', () => { test('Click button', async () => {
const wrapper = shallowMount(FsExample); const wrapper = shallowMount(FsExample);
let domButton = wrapper.find('[data-test="fs-example-button"]'); let domButton = wrapper.find('[data-test="fs-example-button"]');
domButton.trigger('click'); domButton.trigger('click');
await wrapper.vm.$nextTick();
expect(window.nw.require) expect(window.nw.require)
.toHaveBeenCalledWith('fs'); .toHaveBeenCalledWith('fs');
expect(wrapper.html()) expect(wrapper)
.toMatchSnapshot(); .toMatchSnapshot();
}); });
test('Error state', () => { test('Error state', async () => {
window.nw.require.mockImplementation((module) => { window.nw.require.mockImplementation((module) => {
if (module === 'fs') { if (module === 'fs') {
return new Error(); return new Error();
@ -32,10 +34,12 @@ describe('FsExample.vue', () => {
let domButton = wrapper.find('[data-test="fs-example-button"]'); let domButton = wrapper.find('[data-test="fs-example-button"]');
domButton.trigger('click'); domButton.trigger('click');
await wrapper.vm.$nextTick();
expect(window.nw.require) expect(window.nw.require)
.toHaveBeenCalledWith('fs'); .toHaveBeenCalledWith('fs');
expect(wrapper.html()) expect(wrapper)
.toMatchSnapshot(); .toMatchSnapshot();
}); });
}); });

View File

@ -15,23 +15,23 @@ describe('HelloWorld.vue', () => {
test('Render default contents', () => { test('Render default contents', () => {
const wrapper = mount(HelloWorld); const wrapper = mount(HelloWorld);
expect(wrapper.html()) expect(wrapper)
.toMatchSnapshot(); .toMatchSnapshot();
}); });
test('Activate dev tools', () => { test('Activate dev tools', async () => {
const wrapper = shallowMount(HelloWorld); const wrapper = shallowMount(HelloWorld);
const button = wrapper.find('[data-test="toggleDevTools"]'); const button = wrapper.find('[data-test="toggleDevTools"]');
button.trigger('click'); button.trigger('click');
wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.find('[data-test="toggleDevTools').html()) expect(wrapper.find('[data-test="toggleDevTools').html())
.toMatchSnapshot('hide'); .toMatchSnapshot('hide');
button.trigger('click'); button.trigger('click');
wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.find('[data-test="toggleDevTools').html()) expect(wrapper.find('[data-test="toggleDevTools').html())
.toMatchSnapshot('show'); .toMatchSnapshot('show');

View File

@ -32,7 +32,7 @@ describe('LinkList.vue', () => {
propsData: { links: [link] } propsData: { links: [link] }
}); });
expect(wrapper.html()) expect(wrapper)
.toMatchSnapshot(); .toMatchSnapshot();
}); });

View File

@ -24,10 +24,10 @@ exports[`HelloWorld.vue Render default contents 1`] = `
<h3> <h3>
You are using You are using
Vue.js (v2.6.11), Vue.js (v2.6.11),
NW.js (v0.43.6-sdk), NW.js (v0.47.0-sdk),
Node.js (v13.6.0), Node.js (v14.5.0),
and and
Chromium (v79.0.3945.130). Chromium (v84.0.4147.89).
</h3> </h3>
<button> <button>
Show Show

View File

@ -27,10 +27,10 @@ global.beforeEach(() => {
NODE_ENV: 'development' NODE_ENV: 'development'
}, },
versions: { versions: {
chromium: '79.0.3945.130', chromium: '84.0.4147.89',
nw: '0.43.6', nw: '0.47.0',
'nw-flavor': 'sdk', 'nw-flavor': 'sdk',
node: '13.6.0' node: '14.5.0'
} }
}; };
window.nw = { window.nw = {