├── .editorconfig ├── .eslintrc.js ├── .gitignore ├── .postcssrc.js ├── .vs ├── ProjectSettings.json ├── config │ └── applicationhost.config └── slnx.sqlite ├── CHANGELOG.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── LICENSE ├── README.md ├── babel.config.js ├── jest.config.js ├── package.json ├── public ├── favicon.ico ├── img │ ├── avatars │ │ ├── 1.jpg │ │ ├── 2.jpg │ │ ├── 3.jpg │ │ ├── 4.jpg │ │ ├── 5.jpg │ │ ├── 6.jpg │ │ ├── 7.jpg │ │ └── 8.jpg │ ├── brand │ │ ├── logo.svg │ │ └── sygnet.svg │ ├── favicon.png │ ├── logo-symbol.png │ └── logo.png ├── index.html └── site.webmanifest ├── src ├── App.vue ├── _nav.js ├── assets │ ├── .gitkeep │ └── scss │ │ ├── _custom.scss │ │ ├── _ie-fix.scss │ │ ├── _variables.scss │ │ ├── style.scss │ │ └── vendors │ │ ├── _variables.scss │ │ └── chart.js │ │ └── chart.scss ├── config │ └── index.js ├── containers │ ├── DefaultAside.vue │ ├── DefaultContainer.vue │ └── DefaultHeaderDropdownAccnt.vue ├── main.js ├── msal │ └── index.js ├── router │ └── index.js ├── shared │ ├── classes.js │ ├── toggle-classes.js │ └── utils.js └── views │ ├── Charts.vue │ ├── Dashboard.vue │ ├── Widgets.vue │ ├── auth │ ├── Callback.vue │ ├── Login.vue │ ├── Register.vue │ └── Test.vue │ ├── base │ ├── Breadcrumbs.vue │ ├── Cards.vue │ ├── Carousels.vue │ ├── Collapses.vue │ ├── Forms.vue │ ├── Jumbotrons.vue │ ├── ListGroups.vue │ ├── Navbars.vue │ ├── Navs.vue │ ├── Paginations.vue │ ├── Popovers.vue │ ├── ProgressBars.vue │ ├── Switches.vue │ ├── Table.vue │ ├── Tables.vue │ ├── Tabs.vue │ └── Tooltips.vue │ ├── buttons │ ├── BrandButtons.vue │ ├── ButtonGroups.vue │ ├── Dropdowns.vue │ └── StandardButtons.vue │ ├── charts │ ├── BarExample.vue │ ├── DoughnutExample.vue │ ├── LineExample.vue │ ├── PieExample.vue │ ├── PolarAreaExample.vue │ └── RadarExample.vue │ ├── dashboard │ ├── CalloutChartExample.vue │ ├── CardBarChartExample.vue │ ├── CardLine1ChartExample.vue │ ├── CardLine2ChartExample.vue │ ├── CardLine3ChartExample.vue │ ├── MainChartExample.vue │ └── SocialBoxChartExample.vue │ ├── icons │ ├── CoreUIIcons.vue │ ├── Flags.vue │ ├── FontAwesome.vue │ └── SimpleLineIcons.vue │ ├── notifications │ ├── Alerts.vue │ ├── Badges.vue │ └── Modals.vue │ ├── pages │ ├── Login.vue │ ├── Page404.vue │ ├── Page500.vue │ └── Register.vue │ ├── theme │ ├── ColorTheme.vue │ ├── ColorView.vue │ ├── Colors.vue │ └── Typography.vue │ ├── users │ ├── User.vue │ ├── Users.vue │ └── UsersData.js │ └── widgets │ └── Widget03.vue ├── tests ├── e2e │ ├── custom-assertions │ │ └── elementCount.js │ └── specs │ │ └── test.js └── unit │ ├── .eslintrc.js │ ├── App.spec.js │ ├── containers │ ├── DefaultAside.spec.js │ ├── DefaultContainer.spec.js │ ├── DefaultHeaderDropdownAccnt.spec.js │ └── __snapshots__ │ │ ├── DefaultAside.spec.js.snap │ │ ├── DefaultContainer.spec.js.snap │ │ └── DefaultHeaderDropdownAccnt.spec.js.snap │ ├── shared │ ├── classes.spec.js │ ├── toggle-classes.spec.js │ └── utils.spec.js │ └── views │ ├── Charts.spec.js │ ├── Dashboard.spec.js │ ├── Widgets.spec.js │ ├── __snapshots__ │ ├── Charts.spec.js.snap │ ├── Dashboard.spec.js.snap │ └── Widgets.spec.js.snap │ ├── base │ ├── Breadcrumbs.spec.js │ ├── Cards.spec.js │ ├── Carousels.spec.js │ ├── Collapses.spec.js │ ├── Forms.spec.js │ ├── Jumbotrons.spec.js │ ├── ListGroups.spec.js │ ├── Navbars.spec.js │ ├── Navs.spec.js │ ├── Paginations.spec.js │ ├── Popovers.spec.js │ ├── ProgressBars.spec.js │ ├── Switches.spec.js │ ├── Table.spec.js │ ├── Tables.spec.js │ ├── Tabs.spec.js │ ├── Tooltips.spec.js │ └── __snapshots__ │ │ ├── Breadcrumbs.spec.js.snap │ │ ├── Cards.spec.js.snap │ │ ├── Carousels.spec.js.snap │ │ ├── Collapses.spec.js.snap │ │ ├── Forms.spec.js.snap │ │ ├── Jumbotrons.spec.js.snap │ │ ├── ListGroups.spec.js.snap │ │ ├── Navbars.spec.js.snap │ │ ├── Navs.spec.js.snap │ │ ├── Paginations.spec.js.snap │ │ ├── Popovers.spec.js.snap │ │ ├── ProgressBars.spec.js.snap │ │ ├── Switches.spec.js.snap │ │ ├── Table.spec.js.snap │ │ ├── Tables.spec.js.snap │ │ ├── Tabs.spec.js.snap │ │ └── Tooltips.spec.js.snap │ ├── buttons │ ├── BrandButtons.spec.js │ ├── ButtonDropdowns.spec.js │ ├── ButtonGroups.spec.js │ ├── StandardButtons.spec.js │ └── __snapshots__ │ │ ├── BrandButtons.spec.js.snap │ │ ├── ButtonDropdowns.spec.js.snap │ │ ├── ButtonGroups.spec.js.snap │ │ └── StandardButtons.spec.js.snap │ ├── icons │ ├── CoreUIIcons.spec.js │ ├── Flags.spec.js │ ├── FontAwesome.spec.js │ ├── SimpleLineIcons.spec.js │ └── __snapshots__ │ │ ├── CoreUIIcons.spec.js.snap │ │ ├── Flags.spec.js.snap │ │ ├── FontAwesome.spec.js.snap │ │ └── SimpleLineIcons.spec.js.snap │ ├── notifications │ ├── Alerts.spec.js │ ├── Badges.spec.js │ ├── Modals.spec.js │ └── __snapshots__ │ │ ├── Alerts.spec.js.snap │ │ ├── Badges.spec.js.snap │ │ └── Modals.spec.js.snap │ ├── pages │ ├── Login.spec.js │ ├── Page404.spec.js │ ├── Page500.spec.js │ ├── Register.spec.js │ └── __snapshots__ │ │ ├── Login.spec.js.snap │ │ ├── Page404.spec.js.snap │ │ ├── Page500.spec.js.snap │ │ └── Register.spec.js.snap │ ├── theme │ ├── Colors.spec.js │ ├── Typography.spec.js │ └── __snapshots__ │ │ ├── Colors.spec.js.snap │ │ └── Typography.spec.js.snap │ └── users │ ├── User.spec.js │ ├── Users.spec.js │ └── __snapshots__ │ ├── User.spec.js.snap │ └── Users.spec.js.snap └── vue.config.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_size = 2 8 | indent_style = space 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | 12 | [*.md] 13 | max_line_length = off 14 | trim_trailing_whitespace = false 15 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | 'eslint:recommended' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 16 | } 17 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | package-lock.json 4 | /dist 5 | /coverage 6 | 7 | /tests/e2e/reports/ 8 | selenium-debug.log 9 | 10 | # local env files 11 | .env.local 12 | .env.*.local 13 | 14 | # Log files 15 | npm-debug.log* 16 | yarn-debug.log* 17 | yarn-error.log* 18 | 19 | # Editor directories and files 20 | .idea 21 | .vscode 22 | *.suo 23 | *.ntvs* 24 | *.njsproj 25 | *.sln 26 | *.sw* 27 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } -------------------------------------------------------------------------------- /.vs/ProjectSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "CurrentProjectSetting": null 3 | } -------------------------------------------------------------------------------- /.vs/slnx.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kvaes/TasmanianTraders-MSAL-AdvancedVueJsExample/19dce0da0edb14849dec5b4a9d4ba12511819bd4/.vs/slnx.sqlite -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Before opening an issue: 2 | 3 | - [Search for duplicate or closed issues](https://github.com/coreui/coreui-free-vue-admin-template/issues?utf8=%E2%9C%93&q=is%3Aissue) 4 | - Prepare a [reduced test case](https://css-tricks.com/reduced-test-cases/) for any bugs 5 | - Read the [contributing guidelines](https://github.com/coreui/coreui-free-vue-admin-template/blob/master/CONTRIBUTING.md) 6 | 7 | When asking general "how to" questions: 8 | 9 | - Please do not open an issue here 10 | 11 | When reporting a bug, include: 12 | 13 | - Operating system and version (Windows, Mac OS X, Android, iOS, Win10 Mobile) 14 | - Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser) 15 | - Reduced test cases and potential fixes using [CodePen](https://codepen.io/) or [JS Bin](https://jsbin.com/) 16 | 17 | When suggesting a feature, include: 18 | 19 | - As much detail as possible for what we should add and why it's important to CoreUI Admin Template 20 | - Relevant links to prior art, screenshots, or live demos whenever possible 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 creativeLabs Łukasz Holeczek. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Credits 2 | * [CoreUI Template](http://coreui.io) 3 | * [MSAL for JS](https://github.com/AzureAD/microsoft-authentication-library-for-js/) 4 | * [Stack Overflow thread on the integration](https://stackoverflow.com/questions/52944052/creating-a-single-instance-of-a-class-within-a-vue-application) 5 | * [Sunil Bandla's previous example](https://github.com/sunilbandla/vue-msal-sample) 6 | 7 | ## Status 8 | 9 | One time fork of a cleaned project I was working on to help everyone who has been cursing on getting the integration working like me. ;-) 10 | 11 | ## Things changed 12 | * src/main.js 13 | * msal/* 14 | * config/* 15 | * router/* 16 | * containers/DefaultHeaderDropdownAccnt.vue 17 | * views/auth/* 18 | 19 | ## What to expect 20 | ### Testing 21 | Browsing to URI/auth/test will give you an isolated testing page 22 | 23 | ### Header 24 | The header will provide you with a typical flow on how to do a login (redirect method) and logout (redirect to home page) 25 | 26 | ## Challenges 27 | As the Stack Overflow thread states... Sharing the data/objects across components isn't always easy (understatement). Leveraging the vue root/parent/base instance itself was key to getting everything working. In essence it's providing a wrapper class for the library and initilizing it on the root/parent/base instance. 28 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | moduleFileExtensions: [ 3 | 'js', 4 | 'jsx', 5 | 'json', 6 | 'vue' 7 | ], 8 | transform: { 9 | '^.+\\.vue$': 'vue-jest', 10 | '.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', 11 | '^.+\\.jsx?$': 'babel-jest' 12 | }, 13 | moduleNameMapper: { 14 | '^@/(.*)$': '/src/$1' 15 | }, 16 | snapshotSerializers: [ 17 | 'jest-serializer-vue' 18 | ], 19 | testMatch: [ 20 | '/(tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx))', 21 | '/tests/unit/Dashboard.spec.js' 22 | ], 23 | verbose: true, 24 | testURL: "http://localhost/", 25 | collectCoverage: true, 26 | collectCoverageFrom: [ 27 | "src/**/*.{js,vue}", 28 | "!**/node_modules/**" 29 | ], 30 | coverageReporters: ["html", "text-summary"] 31 | } 32 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@coreui/coreui-free-vue-admin-template", 3 | "version": "2.1.1", 4 | "description": "Open Source Bootstrap Admin Template", 5 | "author": "Łukasz Holeczek", 6 | "homepage": "http://coreui.io", 7 | "copyright": "Copyright 2018 creativeLabs Łukasz Holeczek", 8 | "license": "MIT", 9 | "scripts": { 10 | "serve": "vue-cli-service serve", 11 | "build": "vue-cli-service build", 12 | "lint": "vue-cli-service lint", 13 | "test:unit": "vue-cli-service test:unit", 14 | "test:e2e": "vue-cli-service test:e2e" 15 | }, 16 | "dependencies": { 17 | "@coreui/coreui": "^2.1.5", 18 | "@coreui/coreui-plugin-chartjs-custom-tooltips": "^1.2.0", 19 | "@coreui/icons": "0.3.0", 20 | "@coreui/vue": "^2.1.1", 21 | "axios": "^0.18.0", 22 | "bootstrap": "^4.2.1", 23 | "bootstrap-vue": "^2.0.0-rc.11", 24 | "chart.js": "^2.7.3", 25 | "core-js": "^2.6.1", 26 | "css-vars-ponyfill": "^1.16.2", 27 | "flag-icon-css": "^3.2.0", 28 | "font-awesome": "^4.7.0", 29 | "jwt-decode": "^2.2.0", 30 | "msal": "^0.2.4", 31 | "perfect-scrollbar": "^1.4.0", 32 | "simple-line-icons": "^2.4.1", 33 | "vue": "^2.5.21", 34 | "vue-chartjs": "^3.4.0", 35 | "vue-perfect-scrollbar": "^0.1.0", 36 | "vue-router": "^3.0.2" 37 | }, 38 | "devDependencies": { 39 | "@vue/cli-plugin-babel": "^3.3.0", 40 | "@vue/cli-plugin-e2e-nightwatch": "^3.3.0", 41 | "@vue/cli-plugin-eslint": "^3.3.0", 42 | "@vue/cli-plugin-unit-jest": "^3.3.0", 43 | "@vue/cli-service": "^3.3.0", 44 | "@vue/test-utils": "^1.0.0-beta.28", 45 | "babel-core": "^7.0.0-bridge.0", 46 | "babel-jest": "^23.6.0", 47 | "growl": "^1.10.5", 48 | "https-proxy-agent": "^2.2.1", 49 | "node-sass": "^4.11.0", 50 | "sass-loader": "^7.1.0", 51 | "vue-template-compiler": "^2.5.21" 52 | }, 53 | "browserslist": [ 54 | "> 1%", 55 | "last 2 versions", 56 | "not ie <= 9" 57 | ], 58 | "engines": { 59 | "node": ">= 8.10.x", 60 | "npm": ">= 5.6.0" 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kvaes/TasmanianTraders-MSAL-AdvancedVueJsExample/19dce0da0edb14849dec5b4a9d4ba12511819bd4/public/favicon.ico -------------------------------------------------------------------------------- /public/img/avatars/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kvaes/TasmanianTraders-MSAL-AdvancedVueJsExample/19dce0da0edb14849dec5b4a9d4ba12511819bd4/public/img/avatars/1.jpg -------------------------------------------------------------------------------- /public/img/avatars/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kvaes/TasmanianTraders-MSAL-AdvancedVueJsExample/19dce0da0edb14849dec5b4a9d4ba12511819bd4/public/img/avatars/2.jpg -------------------------------------------------------------------------------- /public/img/avatars/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kvaes/TasmanianTraders-MSAL-AdvancedVueJsExample/19dce0da0edb14849dec5b4a9d4ba12511819bd4/public/img/avatars/3.jpg -------------------------------------------------------------------------------- /public/img/avatars/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kvaes/TasmanianTraders-MSAL-AdvancedVueJsExample/19dce0da0edb14849dec5b4a9d4ba12511819bd4/public/img/avatars/4.jpg -------------------------------------------------------------------------------- /public/img/avatars/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kvaes/TasmanianTraders-MSAL-AdvancedVueJsExample/19dce0da0edb14849dec5b4a9d4ba12511819bd4/public/img/avatars/5.jpg -------------------------------------------------------------------------------- /public/img/avatars/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kvaes/TasmanianTraders-MSAL-AdvancedVueJsExample/19dce0da0edb14849dec5b4a9d4ba12511819bd4/public/img/avatars/6.jpg -------------------------------------------------------------------------------- /public/img/avatars/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kvaes/TasmanianTraders-MSAL-AdvancedVueJsExample/19dce0da0edb14849dec5b4a9d4ba12511819bd4/public/img/avatars/7.jpg -------------------------------------------------------------------------------- /public/img/avatars/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kvaes/TasmanianTraders-MSAL-AdvancedVueJsExample/19dce0da0edb14849dec5b4a9d4ba12511819bd4/public/img/avatars/8.jpg -------------------------------------------------------------------------------- /public/img/brand/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 33 | 41 | 46 | 47 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /public/img/brand/sygnet.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 33 | 41 | 46 | 47 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /public/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kvaes/TasmanianTraders-MSAL-AdvancedVueJsExample/19dce0da0edb14849dec5b4a9d4ba12511819bd4/public/img/favicon.png -------------------------------------------------------------------------------- /public/img/logo-symbol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kvaes/TasmanianTraders-MSAL-AdvancedVueJsExample/19dce0da0edb14849dec5b4a9d4ba12511819bd4/public/img/logo-symbol.png -------------------------------------------------------------------------------- /public/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kvaes/TasmanianTraders-MSAL-AdvancedVueJsExample/19dce0da0edb14849dec5b4a9d4ba12511819bd4/public/img/logo.png -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | CoreUI - Vue Open Source Bootstrap Admin Template 9 | 10 | 11 | 38 | 39 | 40 | 43 |
44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /public/site.webmanifest: -------------------------------------------------------------------------------- 1 | {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | 11 | 27 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kvaes/TasmanianTraders-MSAL-AdvancedVueJsExample/19dce0da0edb14849dec5b4a9d4ba12511819bd4/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/assets/scss/_custom.scss: -------------------------------------------------------------------------------- 1 | // Here you can add other styles 2 | -------------------------------------------------------------------------------- /src/assets/scss/_ie-fix.scss: -------------------------------------------------------------------------------- 1 | //IE fix for sticky footer 2 | @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { 3 | .app { 4 | height: 100%; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/assets/scss/_variables.scss: -------------------------------------------------------------------------------- 1 | // Variable overrides 2 | -------------------------------------------------------------------------------- /src/assets/scss/style.scss: -------------------------------------------------------------------------------- 1 | // If you want to override variables do it here 2 | @import "variables"; 3 | 4 | // Import styles 5 | @import "~@coreui/coreui/scss/coreui"; 6 | 7 | // If you want to add something do it here 8 | @import "custom"; 9 | 10 | // ie fixes 11 | @import "ie-fix"; 12 | -------------------------------------------------------------------------------- /src/assets/scss/vendors/_variables.scss: -------------------------------------------------------------------------------- 1 | // Override Boostrap variables 2 | @import "../variables"; 3 | @import "~bootstrap/scss/mixins"; 4 | @import "~@coreui/coreui/scss/variables"; 5 | -------------------------------------------------------------------------------- /src/assets/scss/vendors/chart.js/chart.scss: -------------------------------------------------------------------------------- 1 | // Import variables 2 | @import '../variables'; 3 | 4 | .chart-legend, 5 | .bar-legend, 6 | .line-legend, 7 | .pie-legend, 8 | .radar-legend, 9 | .polararea-legend, 10 | .doughnut-legend { 11 | list-style-type: none; 12 | margin-top: 5px; 13 | text-align: center; 14 | -webkit-padding-start: 0; 15 | -moz-padding-start: 0; 16 | padding-left: 0; 17 | } 18 | .chart-legend li, 19 | .bar-legend li, 20 | .line-legend li, 21 | .pie-legend li, 22 | .radar-legend li, 23 | .polararea-legend li, 24 | .doughnut-legend li { 25 | display: inline-block; 26 | white-space: nowrap; 27 | position: relative; 28 | margin-bottom: 4px; 29 | @include border-radius($border-radius); 30 | padding: 2px 8px 2px 28px; 31 | font-size: smaller; 32 | cursor: default; 33 | } 34 | .chart-legend li span, 35 | .bar-legend li span, 36 | .line-legend li span, 37 | .pie-legend li span, 38 | .radar-legend li span, 39 | .polararea-legend li span, 40 | .doughnut-legend li span { 41 | display: block; 42 | position: absolute; 43 | left: 0; 44 | top: 0; 45 | width: 20px; 46 | height: 20px; 47 | @include border-radius($border-radius); 48 | } 49 | -------------------------------------------------------------------------------- /src/config/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | clientid: 'your-cient-id', 3 | redirecturl: 'http://localhost:8080/callback', 4 | authority: 'https://login.microsoftonline.com/common', 5 | graphscopes: ['user.read'], 6 | graphendpoint: 'https://graph.microsoft.com/v1.0/me', 7 | appinsightsid: '' 8 | } 9 | -------------------------------------------------------------------------------- /src/containers/DefaultContainer.vue: -------------------------------------------------------------------------------- 1 | 63 | 64 | 103 | -------------------------------------------------------------------------------- /src/containers/DefaultHeaderDropdownAccnt.vue: -------------------------------------------------------------------------------- 1 | 47 | 48 | 79 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import 'core-js/es6/promise' 4 | import 'core-js/es6/string' 5 | import 'core-js/es7/array' 6 | 7 | import Vue from 'vue' 8 | import BootstrapVue from 'bootstrap-vue' 9 | import App from './App' 10 | import router from './router' 11 | import AuthService from './msal' 12 | 13 | Vue.prototype.$AuthService = new AuthService() 14 | 15 | Vue.use(BootstrapVue) 16 | 17 | /* eslint-disable no-new */ 18 | new Vue({ 19 | el: '#app', 20 | router, 21 | template: '', 22 | components: { 23 | App 24 | } 25 | }) 26 | -------------------------------------------------------------------------------- /src/msal/index.js: -------------------------------------------------------------------------------- 1 | import * as Msal from 'msal' 2 | import config from '../config' 3 | // With a lot of help from ; https://stackoverflow.com/questions/52944052/creating-a-single-instance-of-a-class-within-a-vue-application 4 | // https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-core/src/UserAgentApplication.ts 5 | 6 | export default class AuthService { 7 | constructor() { 8 | // let redirectUri = window.location.origin; 9 | let redirectUri = config.redirecturl 10 | let PostLogoutRedirectUri = '/' 11 | this.graphUrl = config.graphendpoint 12 | this.applicationConfig = { 13 | clientID: config.clientid, 14 | authority: config.authority, 15 | graphScopes: config.graphscopes 16 | } 17 | this.app = new Msal.UserAgentApplication( 18 | this.applicationConfig.clientID, 19 | this.applicationConfig.authority, 20 | () => { 21 | // callback for login redirect 22 | }, 23 | { 24 | redirectUri 25 | } 26 | ) 27 | } 28 | 29 | // Core Functionality 30 | loginPopup() { 31 | return this.app.loginPopup(this.applicationConfig.graphScopes).then( 32 | idToken => { 33 | const user = this.app.getUser(); 34 | if (user) { 35 | return user; 36 | } else { 37 | return null; 38 | } 39 | }, 40 | () => { 41 | return null; 42 | } 43 | ); 44 | } 45 | 46 | loginRedirect() { 47 | this.app.loginRedirect(this.applicationConfig.graphScopes) 48 | } 49 | 50 | logout() { 51 | this.app._user = null 52 | this.app.logout() 53 | } 54 | 55 | // Graph Related 56 | getGraphToken() { 57 | return this.app.acquireTokenSilent(this.applicationConfig.graphScopes).then( 58 | accessToken => { 59 | return accessToken 60 | }, 61 | error => { 62 | return this.app 63 | .acquireTokenPopup(this.applicationConfig.graphScopes) 64 | .then( 65 | accessToken => { 66 | return accessToken 67 | }, 68 | err => { 69 | console.error(err) 70 | } 71 | ) 72 | } 73 | ) 74 | } 75 | 76 | getGraphUserInfo(token) { 77 | const headers = new Headers({ Authorization: `Bearer ${token}` }); 78 | const options = { 79 | headers 80 | }; 81 | return fetch(`${this.graphUrl}`, options) 82 | .then(response => response.json()) 83 | .catch(response => { 84 | throw new Error(response.text()); 85 | }); 86 | } 87 | 88 | // Utility 89 | getUser() { 90 | return this.app.getUser() 91 | } 92 | 93 | } 94 | -------------------------------------------------------------------------------- /src/shared/classes.js: -------------------------------------------------------------------------------- 1 | export const sidebarCssClasses = [ 2 | 'sidebar-show', 3 | 'sidebar-sm-show', 4 | 'sidebar-md-show', 5 | 'sidebar-lg-show', 6 | 'sidebar-xl-show' 7 | ] 8 | 9 | export const asideMenuCssClasses = [ 10 | 'aside-menu-show', 11 | 'aside-menu-sm-show', 12 | 'aside-menu-md-show', 13 | 'aside-menu-lg-show', 14 | 'aside-menu-xl-show' 15 | ] 16 | 17 | export const validBreakpoints = [ 'sm', 'md', 'lg', 'xl' ] 18 | 19 | export function checkBreakpoint (breakpoint, list) { 20 | return list.indexOf(breakpoint) > -1 21 | } 22 | -------------------------------------------------------------------------------- /src/shared/toggle-classes.js: -------------------------------------------------------------------------------- 1 | export default function toggleClasses (toggleClass, classList, force) { 2 | const level = classList.indexOf(toggleClass) 3 | const removeClassList = classList.slice(0, level) 4 | removeClassList.map((className) => document.body.classList.remove(className)) 5 | document.body.classList.toggle(toggleClass, force) 6 | } 7 | -------------------------------------------------------------------------------- /src/shared/utils.js: -------------------------------------------------------------------------------- 1 | export function random (min, max) { 2 | return Math.floor(Math.random() * (max - min + 1) + min) 3 | } 4 | 5 | /** 6 | * Randomize array element order in-place. 7 | * Using Durstenfeld shuffle algorithm. 8 | */ 9 | export const shuffleArray = (array) => { 10 | for (let i = array.length - 1; i > 0; i--) { 11 | let j = Math.floor(Math.random() * (i + 1)) 12 | let temp = array[i] 13 | array[i] = array[j] 14 | array[j] = temp 15 | } 16 | return array 17 | } 18 | -------------------------------------------------------------------------------- /src/views/Charts.vue: -------------------------------------------------------------------------------- 1 | 37 | 57 | -------------------------------------------------------------------------------- /src/views/auth/Callback.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 26 | -------------------------------------------------------------------------------- /src/views/auth/Login.vue: -------------------------------------------------------------------------------- 1 | 46 | 47 | 52 | -------------------------------------------------------------------------------- /src/views/auth/Register.vue: -------------------------------------------------------------------------------- 1 | 58 | 59 | 64 | -------------------------------------------------------------------------------- /src/views/auth/Test.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 68 | 69 | 102 | -------------------------------------------------------------------------------- /src/views/base/Breadcrumbs.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 44 | -------------------------------------------------------------------------------- /src/views/base/Carousels.vue: -------------------------------------------------------------------------------- 1 | 76 | 77 | 98 | -------------------------------------------------------------------------------- /src/views/base/Jumbotrons.vue: -------------------------------------------------------------------------------- 1 | 85 | 86 | 91 | 92 | -------------------------------------------------------------------------------- /src/views/base/Navs.vue: -------------------------------------------------------------------------------- 1 | 121 | 122 | 127 | 128 | -------------------------------------------------------------------------------- /src/views/base/Paginations.vue: -------------------------------------------------------------------------------- 1 | 83 | 84 | 99 | 100 | -------------------------------------------------------------------------------- /src/views/base/Table.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 88 | -------------------------------------------------------------------------------- /src/views/base/Tables.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 87 | -------------------------------------------------------------------------------- /src/views/base/Tooltips.vue: -------------------------------------------------------------------------------- 1 | 118 | 119 | 145 | 146 | -------------------------------------------------------------------------------- /src/views/charts/BarExample.vue: -------------------------------------------------------------------------------- 1 | 40 | -------------------------------------------------------------------------------- /src/views/charts/DoughnutExample.vue: -------------------------------------------------------------------------------- 1 | 24 | -------------------------------------------------------------------------------- /src/views/charts/LineExample.vue: -------------------------------------------------------------------------------- 1 | 49 | -------------------------------------------------------------------------------- /src/views/charts/PieExample.vue: -------------------------------------------------------------------------------- 1 | 24 | -------------------------------------------------------------------------------- /src/views/charts/PolarAreaExample.vue: -------------------------------------------------------------------------------- 1 | 49 | -------------------------------------------------------------------------------- /src/views/charts/RadarExample.vue: -------------------------------------------------------------------------------- 1 | 51 | -------------------------------------------------------------------------------- /src/views/dashboard/CalloutChartExample.vue: -------------------------------------------------------------------------------- 1 | 68 | -------------------------------------------------------------------------------- /src/views/dashboard/CardBarChartExample.vue: -------------------------------------------------------------------------------- 1 | 46 | -------------------------------------------------------------------------------- /src/views/dashboard/CardLine1ChartExample.vue: -------------------------------------------------------------------------------- 1 | 73 | -------------------------------------------------------------------------------- /src/views/dashboard/CardLine2ChartExample.vue: -------------------------------------------------------------------------------- 1 | 74 | -------------------------------------------------------------------------------- /src/views/dashboard/CardLine3ChartExample.vue: -------------------------------------------------------------------------------- 1 | 54 | -------------------------------------------------------------------------------- /src/views/dashboard/MainChartExample.vue: -------------------------------------------------------------------------------- 1 | 101 | -------------------------------------------------------------------------------- /src/views/dashboard/SocialBoxChartExample.vue: -------------------------------------------------------------------------------- 1 | 59 | -------------------------------------------------------------------------------- /src/views/notifications/Badges.vue: -------------------------------------------------------------------------------- 1 | 81 | 82 | 91 | -------------------------------------------------------------------------------- /src/views/pages/Login.vue: -------------------------------------------------------------------------------- 1 | 46 | 47 | 52 | -------------------------------------------------------------------------------- /src/views/pages/Page404.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 33 | -------------------------------------------------------------------------------- /src/views/pages/Page500.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 33 | -------------------------------------------------------------------------------- /src/views/pages/Register.vue: -------------------------------------------------------------------------------- 1 | 58 | 59 | 64 | -------------------------------------------------------------------------------- /src/views/theme/ColorTheme.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 26 | 27 | -------------------------------------------------------------------------------- /src/views/theme/ColorView.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 42 | 43 | -------------------------------------------------------------------------------- /src/views/theme/Colors.vue: -------------------------------------------------------------------------------- 1 | 61 | 62 | 70 | -------------------------------------------------------------------------------- /src/views/users/User.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 52 | -------------------------------------------------------------------------------- /src/views/users/Users.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 94 | 95 | 100 | -------------------------------------------------------------------------------- /src/views/users/UsersData.js: -------------------------------------------------------------------------------- 1 | const usersData = [ 2 | {id: 0, name: 'John Doe', registered: '2018/01/01', role: 'Guest', status: 'Pending'}, 3 | {id: 1, name: 'Samppa Nori', registered: '2018/01/01', role: 'Member', status: 'Active'}, 4 | {id: 2, name: 'Estavan Lykos', registered: '2018/02/01', role: 'Staff', status: 'Banned'}, 5 | {id: 3, name: 'Chetan Mohamed', registered: '2018/02/01', role: 'Admin', status: 'Inactive'}, 6 | {id: 4, name: 'Derick Maximinus', registered: '2018/03/01', role: 'Member', status: 'Pending'}, 7 | {id: 5, name: 'Friderik Dávid', registered: '2018/01/21', role: 'Staff', status: 'Active'}, 8 | {id: 6, name: 'Yiorgos Avraamu', registered: '2018/01/01', role: 'Member', status: 'Active'}, 9 | {id: 7, name: 'Avram Tarasios', registered: '2018/02/01', role: 'Staff', status: 'Banned'}, 10 | {id: 8, name: 'Quintin Ed', registered: '2018/02/01', role: 'Admin', status: 'Inactive'}, 11 | {id: 9, name: 'Enéas Kwadwo', registered: '2018/03/01', role: 'Member', status: 'Pending'}, 12 | {id: 10, name: 'Agapetus Tadeáš', registered: '2018/01/21', role: 'Staff', status: 'Active'}, 13 | {id: 11, name: 'Carwyn Fachtna', registered: '2018/01/01', role: 'Member', status: 'Active'}, 14 | {id: 12, name: 'Nehemiah Tatius', registered: '2018/02/01', role: 'Staff', status: 'Banned'}, 15 | {id: 13, name: 'Ebbe Gemariah', registered: '2018/02/01', role: 'Admin', status: 'Inactive'}, 16 | {id: 14, name: 'Eustorgios Amulius', registered: '2018/03/01', role: 'Member', status: 'Pending'}, 17 | {id: 15, name: 'Leopold Gáspár', registered: '2018/01/21', role: 'Staff', status: 'Active'}, 18 | {id: 16, name: 'Pompeius René', registered: '2018/01/01', role: 'Member', status: 'Active'}, 19 | {id: 17, name: 'Paĉjo Jadon', registered: '2018/02/01', role: 'Staff', status: 'Banned'}, 20 | {id: 18, name: 'Micheal Mercurius', registered: '2018/02/01', role: 'Admin', status: 'Inactive'}, 21 | {id: 19, name: 'Ganesha Dubhghall', registered: '2018/03/01', role: 'Member', status: 'Pending'}, 22 | {id: 20, name: 'Hiroto Šimun', registered: '2018/01/21', role: 'Staff', status: 'Active'}, 23 | {id: 21, name: 'Vishnu Serghei', registered: '2018/01/01', role: 'Member', status: 'Active'}, 24 | {id: 22, name: 'Zbyněk Phoibos', registered: '2018/02/01', role: 'Staff', status: 'Banned'}, 25 | {id: 23, name: 'Einar Randall', registered: '2018/02/01', role: 'Admin', status: 'Inactive'}, 26 | {id: 24, name: 'Félix Troels', registered: '2018/03/21', role: 'Staff', status: 'Active'}, 27 | {id: 25, name: 'Aulus Agmundr', registered: '2018/01/01', role: 'Member', status: 'Pending'}, 28 | {id: 42, name: 'Ford Prefex', registered: '2001/05/21', role: 'Alien', status: 'Don\'t panic!'} 29 | ] 30 | 31 | export default usersData 32 | -------------------------------------------------------------------------------- /src/views/widgets/Widget03.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 31 | 32 | -------------------------------------------------------------------------------- /tests/e2e/custom-assertions/elementCount.js: -------------------------------------------------------------------------------- 1 | // A custom Nightwatch assertion. 2 | // The assertion name is the filename. 3 | // Example usage: 4 | // 5 | // browser.assert.elementCount(selector, count) 6 | // 7 | // For more information on custom assertions see: 8 | // http://nightwatchjs.org/guide#writing-custom-assertions 9 | 10 | exports.assertion = function elementCount (selector, count) { 11 | this.message = `Testing if element <${selector}> has count: ${count}` 12 | this.expected = count 13 | this.pass = val => val === count 14 | this.value = res => res.value 15 | function evaluator (_selector) { 16 | return document.querySelectorAll(_selector).length 17 | } 18 | this.command = cb => this.api.execute(evaluator, [selector], cb) 19 | } 20 | -------------------------------------------------------------------------------- /tests/e2e/specs/test.js: -------------------------------------------------------------------------------- 1 | // For authoring Nightwatch tests, see 2 | // http://nightwatchjs.org/guide#usage 3 | 4 | module.exports = { 5 | 6 | before: function (browser) { 7 | console.log('Setting up... browser', typeof browser) 8 | }, 9 | 10 | after: function (browser) { 11 | console.log('Closing down... browser', typeof browser) 12 | }, 13 | 14 | 'CoreUI Vue e2e tests': function (browser) { 15 | // automatically uses dev Server port from /config.index.js 16 | // default: http://localhost:8080 17 | // see nightwatch.conf.js 18 | 19 | // const devServer = browser.globals.devServerURL 20 | const devServer = process.env.VUE_DEV_SERVER_URL 21 | 22 | 23 | browser.url(devServer).pause(500).expect.element('body').to.be.present 24 | 25 | browser.waitForElementVisible('.app', 10000) 26 | .assert.elementPresent('.app-header') 27 | .assert.elementPresent('.app-header > .navbar-brand') 28 | .assert.elementPresent('.app-body') 29 | .assert.elementPresent('.app-body > .main > .breadcrumb') 30 | .assert.elementPresent('.app-body > .main > .container-fluid > .animated') 31 | .assert.elementPresent('.app-body > .sidebar > .sidebar-nav') 32 | .assert.elementPresent('.app-body > .sidebar > .sidebar-minimizer') 33 | .assert.elementPresent('.app-footer') 34 | .assert.containsText('.app-footer > div > span', 'creativeLabs') 35 | .assert.containsText('.app-footer > div.ml-auto > span', 'Powered by') 36 | .assert.elementCount('button', 10) 37 | .resizeWindow(1024, 800) 38 | .pause(500) 39 | .assert.cssClassNotPresent('body', 'aside-menu-show') 40 | .assert.cssClassNotPresent('body', 'aside-menu-lg-show') 41 | 42 | browser.click('body > div > header > button.d-none.d-lg-block.navbar-toggler', function (response) { 43 | console.log('response', typeof response) 44 | this.assert.ok(browser === this, 'Check if the context is right.') 45 | this.assert.cssClassPresent('body', 'aside-menu-lg-show') 46 | }) 47 | 48 | browser.pause(500) 49 | 50 | browser.click('body > div > header > button.d-none.d-lg-block.navbar-toggler', function (response) { 51 | console.log('response', typeof response) 52 | this.assert.cssClassNotPresent('body', 'aside-menu-lg-show') 53 | }) 54 | 55 | browser.pause(500) 56 | 57 | browser 58 | .useXpath() 59 | .click('/html/body/div/header/button[2]', function (response) { 60 | console.log('response', typeof response) 61 | this.assert.cssClassNotPresent('/html/body', 'sidebar-lg-show') 62 | }) 63 | 64 | browser 65 | .pause(500) 66 | .click('/html/body/div/header/button[2]', function (response) { 67 | console.log('response', typeof response) 68 | this.assert.cssClassPresent('/html/body', 'sidebar-lg-show') 69 | }) 70 | 71 | browser 72 | .pause(500) 73 | .click('/html/body/div/div/div/button', function (response) { 74 | console.log('response', typeof response) 75 | this.assert.cssClassPresent('/html/body', 'sidebar-minimized') 76 | this.assert.cssClassPresent('/html/body', 'brand-minimized') 77 | this.pause(500) 78 | this.assert.cssProperty("/html/body/div/div/main", "margin-left", "50px"); 79 | }) 80 | .pause(500) 81 | .click('/html/body/div/div/div/button', function (response) { 82 | console.log('response', typeof response) 83 | this.assert.cssClassNotPresent('/html/body', 'sidebar-minimized') 84 | this.assert.cssClassNotPresent('/html/body', 'brand-minimized') 85 | }) 86 | 87 | browser 88 | .resizeWindow(800, 600) 89 | .pause(500) 90 | 91 | browser 92 | .pause(500) 93 | .click('/html/body/div/header/button[1]', function (response) { 94 | console.log('response', typeof response) 95 | this.assert.cssClassPresent('/html/body', 'sidebar-show') 96 | this.pause(500) 97 | this.assert.cssProperty("/html/body/div/div/main", "margin-left", "200px"); 98 | }) 99 | 100 | browser 101 | .pause(500) 102 | .click('/html/body/div/div/div/nav/section/ul/li[1]/a', function (response) { 103 | console.log('response', typeof response) 104 | this.assert.cssClassNotPresent('/html/body', 'sidebar-show') 105 | }) 106 | 107 | browser 108 | .resizeWindow(500, 600) 109 | .pause(500) 110 | 111 | .click('/html/body/div/header/button[1]', function (response) { 112 | console.log('response', typeof response) 113 | this.assert.cssClassPresent('/html/body', 'sidebar-show') 114 | this.assert.cssProperty("/html/body/div/div/main", "margin-left", "0px"); 115 | }) 116 | .pause(500) 117 | .click('/html/body/div/div/main', function (response) { 118 | console.log('response', typeof response) 119 | this.assert.cssClassNotPresent('/html/body', 'sidebar-show') 120 | this.assert.cssProperty("/html/body/div/div/main", "margin-left", "0px"); 121 | }) 122 | 123 | browser 124 | .pause(5000) 125 | .end() 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /tests/unit/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | jest: true 4 | }, 5 | rules: { 6 | 'import/no-extraneous-dependencies': 'off' 7 | } 8 | } -------------------------------------------------------------------------------- /tests/unit/App.spec.js: -------------------------------------------------------------------------------- 1 | import { shallowMount, createLocalVue } from '@vue/test-utils' 2 | import VueRouter from 'vue-router' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import App from '@/App' 5 | 6 | const localVue = createLocalVue() 7 | localVue.use(VueRouter) 8 | const router = new VueRouter() 9 | 10 | 11 | localVue.use(BootstrapVue) 12 | 13 | describe('App.vue', () => { 14 | it('has a name', () => { 15 | expect(App.name).toMatch('app') 16 | }) 17 | it('is Vue instance', () => { 18 | const wrapper = shallowMount(App, { 19 | localVue, 20 | router 21 | }) 22 | expect(wrapper.isVueInstance()).toBe(true) 23 | }) 24 | it('is App', () => { 25 | const wrapper = shallowMount(App, { 26 | localVue, 27 | router 28 | }) 29 | expect(wrapper.is(App)).toBe(true) 30 | }) 31 | }) 32 | -------------------------------------------------------------------------------- /tests/unit/containers/DefaultAside.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount } from '@vue/test-utils'; 3 | import BootstrapVue from 'bootstrap-vue' 4 | import DefaultAside from '@/containers/DefaultAside' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('DefaultAside.vue', () => { 9 | it('has a name', () => { 10 | expect(DefaultAside.name).toMatch('DefaultAside') 11 | }) 12 | test('renders correctly', () => { 13 | const wrapper = shallowMount(DefaultAside) 14 | expect(wrapper.element).toMatchSnapshot() 15 | }) 16 | }) 17 | -------------------------------------------------------------------------------- /tests/unit/containers/DefaultContainer.spec.js: -------------------------------------------------------------------------------- 1 | import BootstrapVue from 'bootstrap-vue' 2 | import { shallowMount, createLocalVue } from '@vue/test-utils'; 3 | import VueRouter from 'vue-router' 4 | import DefaultContainer from '@/containers/DefaultContainer' 5 | 6 | const localVue = createLocalVue() 7 | localVue.use(VueRouter) 8 | const router = new VueRouter() 9 | 10 | localVue.use(BootstrapVue) 11 | 12 | describe('DefaultContainer.vue', () => { 13 | it('has a name', () => { 14 | expect(DefaultContainer.name).toMatch('DefaultContainer') 15 | }) 16 | it('has a created hook', () => { 17 | expect(typeof DefaultContainer.data).toMatch('function') 18 | }) 19 | test('renders correctly', () => { 20 | const wrapper = shallowMount(DefaultContainer, { 21 | localVue, 22 | router 23 | }) 24 | expect(wrapper.element).toMatchSnapshot() 25 | }) 26 | it('sets the correct default data', () => { 27 | expect(typeof DefaultContainer.data).toMatch('function') 28 | const defaultData = DefaultContainer.data() 29 | expect(typeof defaultData.nav).toMatch('object') 30 | }) 31 | it('is Vue instance', () => { 32 | const wrapper = shallowMount(DefaultContainer, { 33 | localVue, 34 | router 35 | }) 36 | expect(wrapper.isVueInstance()).toBe(true) 37 | }) 38 | }) 39 | -------------------------------------------------------------------------------- /tests/unit/containers/DefaultHeaderDropdownAccnt.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import BootstrapVue from 'bootstrap-vue' 3 | import DefaultHeaderDropdownAccnt from '@/containers/DefaultHeaderDropdownAccnt' 4 | import { shallowMount } from '@vue/test-utils'; 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('DefaultHeaderDropdownAccnt.vue', () => { 9 | it('has a name', () => { 10 | expect(DefaultHeaderDropdownAccnt.name).toMatch('DefaultHeaderDropdownAccnt') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof DefaultHeaderDropdownAccnt.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof DefaultHeaderDropdownAccnt.data).toMatch('function') 17 | const defaultData = DefaultHeaderDropdownAccnt.data() 18 | expect(defaultData.itemsCount).toBe(42) 19 | }) 20 | test('renders correctly', () => { 21 | const wrapper = shallowMount(DefaultHeaderDropdownAccnt) 22 | expect(wrapper.element).toMatchSnapshot() 23 | }) 24 | }) 25 | -------------------------------------------------------------------------------- /tests/unit/containers/__snapshots__/DefaultContainer.spec.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`DefaultContainer.vue renders correctly 1`] = ` 4 |
7 | 10 | 16 | 17 | 26 | CoreUI Logo 33 | 34 | CoreUI Logo 41 | 42 | 43 | 48 | 49 | 53 | 62 | Dashboard 63 | 64 | 65 | 75 | Users 76 | 77 | 78 | 86 | Settings 87 | 88 | 89 | 90 | 94 | 102 | 105 | 106 | 116 | 5 117 | 118 | 119 | 120 | 128 | 131 | 132 | 133 | 141 | 144 | 145 | 146 | 147 | 148 | 149 | 153 | 154 | 155 |
158 | 161 | 162 | 163 | 164 | 165 | 168 | 169 | 170 | 171 | 172 | 173 | 174 |
177 | 180 | 181 |
184 | 187 |
188 |
189 | 190 | 195 | 196 | 197 |
198 | 199 | 200 |
201 | 204 | CoreUI 205 | 206 | 207 | 210 | © 2018 creativeLabs. 211 | 212 |
213 | 214 |
217 | 220 | Powered by 221 | 222 | 223 | 226 | CoreUI for Vue 227 | 228 |
229 |
230 |
231 | `; 232 | -------------------------------------------------------------------------------- /tests/unit/containers/__snapshots__/DefaultHeaderDropdownAccnt.spec.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`DefaultHeaderDropdownAccnt.vue renders correctly 1`] = ` 4 | 8 | 15 | \\ 16 | 17 | 242 | 243 | `; 244 | -------------------------------------------------------------------------------- /tests/unit/shared/classes.spec.js: -------------------------------------------------------------------------------- 1 | import {sidebarCssClasses, asideMenuCssClasses, validBreakpoints, checkBreakpoint} from '@/shared/classes' 2 | 3 | test('sidebarCssClasses', () => { 4 | expect(sidebarCssClasses.constructor === Array).toBe(true); 5 | expect(sidebarCssClasses.length).toBe(5); 6 | expect(sidebarCssClasses).toContain('sidebar-show'); 7 | expect(sidebarCssClasses).toContain('sidebar-sm-show'); 8 | expect(sidebarCssClasses).toContain('sidebar-md-show'); 9 | expect(sidebarCssClasses).toContain('sidebar-lg-show'); 10 | expect(sidebarCssClasses).toContain('sidebar-xl-show'); 11 | }); 12 | test('asideMenuCssClasses', () => { 13 | expect(asideMenuCssClasses.constructor === Array).toBe(true); 14 | expect(asideMenuCssClasses.length).toBe(5); 15 | expect(asideMenuCssClasses).toContain('aside-menu-show'); 16 | expect(asideMenuCssClasses).toContain('aside-menu-sm-show'); 17 | expect(asideMenuCssClasses).toContain('aside-menu-md-show'); 18 | expect(asideMenuCssClasses).toContain('aside-menu-lg-show'); 19 | expect(asideMenuCssClasses).toContain('aside-menu-xl-show'); 20 | }); 21 | test('validBreakpoints', () => { 22 | expect(validBreakpoints.constructor === Array).toBe(true); 23 | expect(validBreakpoints.length).toBe(4); 24 | expect(validBreakpoints).toContain('sm'); 25 | expect(validBreakpoints).toContain('md'); 26 | expect(validBreakpoints).toContain('lg'); 27 | expect(validBreakpoints).toContain('xl'); 28 | }); 29 | test('checkBreakpoint', () => { 30 | expect(checkBreakpoint.constructor === Function).toBe(true); 31 | expect(checkBreakpoint('sm', validBreakpoints)).toBe(true); 32 | expect(checkBreakpoint('xs', validBreakpoints)).toBe(false); 33 | }); 34 | -------------------------------------------------------------------------------- /tests/unit/shared/toggle-classes.spec.js: -------------------------------------------------------------------------------- 1 | import { sidebarCssClasses } from '@/shared/classes' 2 | import toggleClasses from '@/shared/toggle-classes' 3 | 4 | test('toggleClasses', () => { 5 | const cssClass = `sidebar-show` 6 | expect(toggleClasses.constructor === Function).toBe(true) 7 | toggleClasses(cssClass, sidebarCssClasses ) 8 | console.log(document.body.classList) 9 | expect(document.body.classList).toMatchObject({ '0': 'sidebar-show' }) 10 | toggleClasses("sidebar-xl-show", sidebarCssClasses ) 11 | console.log(document.body.classList) 12 | toggleClasses("sidebar-lg-show", sidebarCssClasses ) 13 | console.log(document.body.classList) 14 | toggleClasses("sidebar-md-show", sidebarCssClasses ) 15 | expect(document.body.classList).toMatchObject({ '0': 'sidebar-xl-show', '1': 'sidebar-lg-show', '2': 'sidebar-md-show' }) 16 | console.log(document.body.classList) 17 | toggleClasses("sidebar-xl-show", sidebarCssClasses ) 18 | console.log(document.body.classList) 19 | toggleClasses(cssClass, sidebarCssClasses ) 20 | expect(document.body.classList).toMatchObject({ '0': 'sidebar-show' }) 21 | console.log(document.body.classList) 22 | }); 23 | -------------------------------------------------------------------------------- /tests/unit/shared/utils.spec.js: -------------------------------------------------------------------------------- 1 | import { random, shuffleArray } from '@/shared/utils' 2 | 3 | test('random', () => { 4 | expect(random.constructor === Function).toBe(true) 5 | expect(random(10,10)).toBe(10); 6 | let nRandom = random(50,200) 7 | expect(nRandom).toBeGreaterThanOrEqual(50) 8 | expect(nRandom).toBeLessThanOrEqual(200) 9 | nRandom = random(80,100) 10 | expect(nRandom).toBeGreaterThanOrEqual(80) 11 | expect(nRandom).toBeLessThanOrEqual(100) 12 | nRandom = random(100,101) 13 | expect(nRandom).toBeGreaterThanOrEqual(100) 14 | expect(nRandom).toBeLessThanOrEqual(101) 15 | }); 16 | 17 | test('shuffleArray', () => { 18 | expect(shuffleArray.constructor === Function).toBe(true) 19 | let testArray = [1,2,3] 20 | expect(shuffleArray(testArray).constructor === Array).toBe(true) 21 | testArray = [{a:1},{a:2},{a:3}] 22 | expect(shuffleArray(testArray).constructor === Array).toBe(true) 23 | }) 24 | -------------------------------------------------------------------------------- /tests/unit/views/Charts.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount } from '@vue/test-utils'; 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Charts from '@/views/Charts' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Charts.vue', () => { 9 | it('has a name', () => { 10 | expect(Charts.name).toMatch('charts') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(Charts) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is Charts', () => { 17 | const wrapper = shallowMount(Charts) 18 | expect(wrapper.is(Charts)).toBe(true) 19 | }) 20 | test('renders correctly', () => { 21 | const wrapper = shallowMount(Charts) 22 | expect(wrapper.element).toMatchSnapshot() 23 | }) 24 | }) 25 | -------------------------------------------------------------------------------- /tests/unit/views/Dashboard.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Dashboard from '@/views/Dashboard' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Dashboard.vue', () => { 9 | it('has a name', () => { 10 | expect(Dashboard.name).toMatch('dashboard') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof Dashboard.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof Dashboard.data).toMatch('function') 17 | const defaultData = Dashboard.data() 18 | expect(defaultData.selected).toMatch('Month') 19 | }) 20 | it('is Vue instance', () => { 21 | const wrapper = shallowMount(Dashboard) 22 | expect(wrapper.isVueInstance()).toBe(true) 23 | }) 24 | it('is Dashboard', () => { 25 | const wrapper = shallowMount(Dashboard) 26 | expect(wrapper.is(Dashboard)).toBe(true) 27 | }) 28 | it('should render correct content', () => { 29 | const wrapper = shallowMount(Dashboard) 30 | expect(wrapper.find('#traffic').text()).toMatch('Traffic') 31 | }) 32 | test('renders correctly', () => { 33 | const wrapper = shallowMount(Dashboard) 34 | expect(wrapper.element).toMatchSnapshot() 35 | }) 36 | it('should have methods', () => { 37 | expect(typeof Dashboard.methods.variant ).toEqual('function') 38 | expect(Dashboard.methods.variant(25)).toBe('info') 39 | expect(Dashboard.methods.variant(50)).toBe('success') 40 | expect(Dashboard.methods.variant(75)).toBe('warning') 41 | expect(Dashboard.methods.variant(100)).toBe('danger') 42 | expect(typeof Dashboard.methods.flag ).toEqual('function') 43 | expect(Dashboard.methods.flag('us')).toBe('flag-icon flag-icon-us') 44 | }) 45 | }) 46 | -------------------------------------------------------------------------------- /tests/unit/views/Widgets.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Widgets from '@/views/Widgets' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Widgets.vue', () => { 9 | it('has a name', () => { 10 | expect(Widgets.name).toMatch('widgets') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof Widgets.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof Widgets.data).toMatch('function') 17 | const defaultData = Widgets.data() 18 | expect(defaultData.msg).toMatch('Widgets') 19 | }) 20 | it('is Vue instance', () => { 21 | const wrapper = shallowMount(Widgets) 22 | expect(wrapper.isVueInstance()).toBe(true) 23 | }) 24 | it('is Widgets', () => { 25 | const wrapper = shallowMount(Widgets) 26 | expect(wrapper.is(Widgets)).toBe(true) 27 | }) 28 | test('renders correctly', () => { 29 | const wrapper = shallowMount(Widgets) 30 | expect(wrapper.element).toMatchSnapshot() 31 | }) 32 | }) 33 | -------------------------------------------------------------------------------- /tests/unit/views/__snapshots__/Charts.spec.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Charts.vue renders correctly 1`] = ` 4 |
7 | 12 | 21 |
24 | 27 |
28 |
29 | 30 | 39 |
42 | 45 |
46 |
47 | 48 | 57 |
60 | 63 |
64 |
65 | 66 | 75 |
78 | 81 |
82 |
83 | 84 | 93 |
96 | 99 |
100 |
101 | 102 | 111 |
114 | 117 |
118 |
119 |
120 |
121 | `; 122 | -------------------------------------------------------------------------------- /tests/unit/views/base/Breadcrumbs.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Breadcrumbs from '@/views/base/Breadcrumbs' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Breadcrumbs.vue', () => { 9 | it('has a name', () => { 10 | expect(Breadcrumbs.name).toMatch('breadcrumbs') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof Breadcrumbs.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof Breadcrumbs.data).toMatch('function') 17 | const defaultData = Breadcrumbs.data() 18 | expect(typeof defaultData.items).toMatch('object') 19 | }) 20 | it('is Vue instance', () => { 21 | const wrapper = shallowMount(Breadcrumbs) 22 | expect(wrapper.isVueInstance()).toBe(true) 23 | }) 24 | it('is Breadcrumbs', () => { 25 | const wrapper = shallowMount(Breadcrumbs) 26 | expect(wrapper.is(Breadcrumbs)).toBe(true) 27 | }) 28 | it('should render correct content', () => { 29 | const wrapper = mount(Breadcrumbs) 30 | expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Breadcrumb') 31 | }) 32 | test('renders correctly', () => { 33 | const wrapper = mount(Breadcrumbs) 34 | expect(wrapper.element).toMatchSnapshot() 35 | }) 36 | }) 37 | -------------------------------------------------------------------------------- /tests/unit/views/base/Cards.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Cards from '@/views/base/Cards' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Cards.vue', () => { 9 | it('has a name', () => { 10 | expect(Cards.name).toMatch('cards') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof Cards.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof Cards.data).toMatch('function') 17 | const defaultData = Cards.data() 18 | expect(defaultData.show).toBe(true) 19 | }) 20 | it('is Vue instance', () => { 21 | const wrapper = shallowMount(Cards) 22 | expect(wrapper.isVueInstance()).toBe(true) 23 | }) 24 | it('is Cards', () => { 25 | const wrapper = shallowMount(Cards) 26 | expect(wrapper.is(Cards)).toBe(true) 27 | }) 28 | it('should render correct content', () => { 29 | const wrapper = mount(Cards) 30 | expect(wrapper.find('div.card-header > div').text()).toMatch('Card title') 31 | }) 32 | test('renders correctly', () => { 33 | const wrapper = mount(Cards) 34 | expect(wrapper.element).toMatchSnapshot() 35 | }) 36 | }) 37 | -------------------------------------------------------------------------------- /tests/unit/views/base/Carousels.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Carousels from '@/views/base/Carousels' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Carousels.vue', () => { 9 | it('has a name', () => { 10 | expect(Carousels.name).toMatch('carousels') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof Carousels.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof Carousels.data).toMatch('function') 17 | const defaultData = Carousels.data() 18 | expect(defaultData.slide).toBe(0) 19 | }) 20 | it('is Vue instance', () => { 21 | const wrapper = shallowMount(Carousels) 22 | expect(wrapper.isVueInstance()).toBe(true) 23 | }) 24 | it('is Carousels', () => { 25 | const wrapper = shallowMount(Carousels) 26 | expect(wrapper.is(Carousels)).toBe(true) 27 | }) 28 | it('should render correct content', () => { 29 | const wrapper = mount(Carousels) 30 | expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Carousel') 31 | }) 32 | test('renders correctly', () => { 33 | const wrapper = mount(Carousels) 34 | expect(wrapper.element).toMatchSnapshot() 35 | }) 36 | it('should have methods', () => { 37 | expect(typeof Carousels.methods.onSlideStart ).toEqual('function') 38 | expect(Carousels.methods.onSlideStart(1)).toBeUndefined() 39 | expect(typeof Carousels.methods.onSlideEnd ).toEqual('function') 40 | expect(Carousels.methods.onSlideEnd(1)).toBeUndefined() 41 | }) 42 | }) 43 | -------------------------------------------------------------------------------- /tests/unit/views/base/Collapses.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Collapses from '@/views/base/Collapses' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Collapses.vue', () => { 9 | it('has a name', () => { 10 | expect(Collapses.name).toMatch('collapses') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof Collapses.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof Collapses.data).toMatch('function') 17 | const defaultData = Collapses.data() 18 | expect(defaultData.showCollapse).toBe(true) 19 | }) 20 | it('is Vue instance', () => { 21 | const wrapper = shallowMount(Collapses) 22 | expect(wrapper.isVueInstance()).toBe(true) 23 | }) 24 | it('is Collapses', () => { 25 | const wrapper = shallowMount(Collapses) 26 | expect(wrapper.is(Collapses)).toBe(true) 27 | }) 28 | it('should render correct content', () => { 29 | const wrapper = mount(Collapses) 30 | expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Collapse') 31 | }) 32 | test('renders correctly', () => { 33 | const wrapper = mount(Collapses) 34 | expect(wrapper.element).toMatchSnapshot() 35 | }) 36 | }) 37 | -------------------------------------------------------------------------------- /tests/unit/views/base/Forms.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Forms from '@/views/base/Forms' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Forms.vue', () => { 9 | it('has a name', () => { 10 | expect(Forms.name).toMatch('forms') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof Forms.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof Forms.data).toMatch('function') 17 | const defaultData = Forms.data() 18 | expect(defaultData.show).toBe(true) 19 | }) 20 | it('is Vue instance', () => { 21 | const wrapper = shallowMount(Forms) 22 | expect(wrapper.isVueInstance()).toBe(true) 23 | }) 24 | it('is Forms', () => { 25 | const wrapper = shallowMount(Forms) 26 | expect(wrapper.is(Forms)).toBe(true) 27 | }) 28 | it('should render correct content', () => { 29 | const wrapper = mount(Forms) 30 | expect(wrapper.find('div.card-header > div > strong').text()).toMatch('Credit Card') 31 | }) 32 | test('renders correctly', () => { 33 | const wrapper = shallowMount(Forms) 34 | expect(wrapper.element).toMatchSnapshot() 35 | }) 36 | }) 37 | -------------------------------------------------------------------------------- /tests/unit/views/base/Jumbotrons.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Jumbotrons from '@/views/base/Jumbotrons' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Jumbotrons.vue', () => { 9 | it('has a name', () => { 10 | expect(Jumbotrons.name).toMatch('jumbotrons') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(Jumbotrons) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is Jumbotrons', () => { 17 | const wrapper = shallowMount(Jumbotrons) 18 | expect(wrapper.is(Jumbotrons)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = mount(Jumbotrons) 22 | expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Jumbotron') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = shallowMount(Jumbotrons) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/base/ListGroups.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import ListGroups from '@/views/base/ListGroups' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('ListGroups.vue', () => { 9 | it('has a name', () => { 10 | expect(ListGroups.name).toMatch('list-groups') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(ListGroups) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is ListGroups', () => { 17 | const wrapper = shallowMount(ListGroups) 18 | expect(wrapper.is(ListGroups)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = mount(ListGroups) 22 | expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap list group') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = shallowMount(ListGroups) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/base/Navbars.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Navbars from '@/views/base/Navbars' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Navbars.vue', () => { 9 | it('has a name', () => { 10 | expect(Navbars.name).toMatch('navbars') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(Navbars) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is Navbars', () => { 17 | const wrapper = shallowMount(Navbars) 18 | expect(wrapper.is(Navbars)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = mount(Navbars) 22 | expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Navbar') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = shallowMount(Navbars) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/base/Navs.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Navs from '@/views/base/Navs' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Navs.vue', () => { 9 | it('has a name', () => { 10 | expect(Navs.name).toMatch('navs') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(Navs) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is Navbars', () => { 17 | const wrapper = shallowMount(Navs) 18 | expect(wrapper.is(Navs)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = mount(Navs) 22 | expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Navs') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = shallowMount(Navs) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/base/Paginations.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Paginations from '@/views/base/Paginations' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Paginations.vue', () => { 9 | it('has a name', () => { 10 | expect(Paginations.name).toMatch('paginations') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof Paginations.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof Paginations.data).toMatch('function') 17 | const defaultData = Paginations.data() 18 | expect(defaultData.currentPage).toBe(3) 19 | }) 20 | it('is Vue instance', () => { 21 | const wrapper = shallowMount(Paginations) 22 | expect(wrapper.isVueInstance()).toBe(true) 23 | }) 24 | it('is Paginations', () => { 25 | const wrapper = shallowMount(Paginations) 26 | expect(wrapper.is(Paginations)).toBe(true) 27 | }) 28 | it('should render correct content', () => { 29 | const wrapper = mount(Paginations) 30 | expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Pagination') 31 | }) 32 | test('renders correctly', () => { 33 | const wrapper = shallowMount(Paginations) 34 | expect(wrapper.element).toMatchSnapshot() 35 | }) 36 | }) 37 | -------------------------------------------------------------------------------- /tests/unit/views/base/Popovers.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { mount, shallowMount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Popovers from '@/views/base/Popovers' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Popovers.vue', () => { 9 | it('has a name', () => { 10 | expect(Popovers.name).toMatch('popovers') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof Popovers.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof Popovers.data).toMatch('function') 17 | const defaultData = Popovers.data() 18 | expect(defaultData.show).toBe(false) 19 | }) 20 | it('is Vue instance', () => { 21 | const wrapper = shallowMount(Popovers) 22 | expect(wrapper.isVueInstance()).toBe(true) 23 | }) 24 | it('is Popovers', () => { 25 | const wrapper = shallowMount(Popovers) 26 | expect(wrapper.is(Popovers)).toBe(true) 27 | }) 28 | it('should render correct content', () => { 29 | const wrapper = mount(Popovers) 30 | expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Popovers') 31 | }) 32 | test('renders correctly', () => { 33 | const wrapper = shallowMount(Popovers) 34 | expect(wrapper.element).toMatchSnapshot() 35 | }) 36 | it('should have methods', () => { 37 | const wrapper = mount(Popovers) 38 | expect(typeof Popovers.methods.onOpen).toEqual('function') 39 | expect(wrapper.vm.onOpen()).toBeUndefined() 40 | expect(typeof Popovers.methods.onClose).toEqual('function') 41 | expect(wrapper.vm.onClose()).toBeUndefined() 42 | expect(typeof Popovers.methods.onEnable).toEqual('function') 43 | expect(wrapper.vm.onEnable()).toBeUndefined() 44 | expect(typeof Popovers.methods.onDisable).toEqual('function') 45 | expect(wrapper.vm.onDisable()).toBeUndefined() 46 | }) 47 | }) 48 | -------------------------------------------------------------------------------- /tests/unit/views/base/ProgressBars.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { mount, shallowMount } from '@vue/test-utils'; 3 | import BootstrapVue from 'bootstrap-vue' 4 | import ProgressBars from '@/views/base/ProgressBars' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | jest.useFakeTimers() 9 | 10 | describe('ProgressBars.vue', () => { 11 | it('has a name', () => { 12 | expect(ProgressBars.name).toMatch('progress-bars') 13 | }) 14 | it('has a created hook', () => { 15 | expect(typeof ProgressBars.data).toMatch('function') 16 | }) 17 | it('sets the correct default data', () => { 18 | expect(typeof ProgressBars.data).toMatch('function') 19 | const defaultData = ProgressBars.data() 20 | expect(defaultData.counter).toBe(45) 21 | }) 22 | it('is Vue instance', () => { 23 | const wrapper = mount(ProgressBars) 24 | expect(wrapper.isVueInstance()).toBe(true) 25 | }) 26 | it('is ProgressBars', () => { 27 | const wrapper = mount(ProgressBars) 28 | expect(wrapper.is(ProgressBars)).toBe(true) 29 | }) 30 | it('should render correct content', () => { 31 | const wrapper = mount(ProgressBars) 32 | expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Progress') 33 | }) 34 | test('renders correctly', () => { 35 | const wrapper = shallowMount(ProgressBars) 36 | expect(wrapper.element).toMatchSnapshot() 37 | }) 38 | it('should be destroyed', () => { 39 | const wrapper = mount(ProgressBars) 40 | wrapper.destroy() 41 | }) 42 | it('should have methods', () => { 43 | expect(typeof ProgressBars.methods.clicked ).toEqual('function') 44 | expect(ProgressBars.methods.clicked()).toBeUndefined() 45 | }) 46 | }) 47 | -------------------------------------------------------------------------------- /tests/unit/views/base/Switches.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { mount, shallowMount } from '@vue/test-utils'; 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Switches from '@/views/base/Switches' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Switches.vue', () => { 9 | it('has a name', () => { 10 | expect(Switches.name).toMatch('switches') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof Switches.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof Switches.data).toMatch('function') 17 | const defaultData = Switches.data() 18 | expect(typeof defaultData.fields).toMatch('object') 19 | expect(defaultData.checker).toMatch('yes') 20 | }) 21 | it('is Vue instance', () => { 22 | const wrapper = mount(Switches) 23 | expect(wrapper.isVueInstance()).toBe(true) 24 | }) 25 | it('is Switches', () => { 26 | const wrapper = mount(Switches) 27 | expect(wrapper.is(Switches)).toBe(true) 28 | }) 29 | it('should render correct content', () => { 30 | const wrapper = mount(Switches) 31 | expect(wrapper.find('div.card-header > div').text()).toMatch('Switch default') 32 | }) 33 | test('renders correctly', () => { 34 | const wrapper = shallowMount(Switches) 35 | expect(wrapper.element).toMatchSnapshot() 36 | }) 37 | }) 38 | -------------------------------------------------------------------------------- /tests/unit/views/base/Table.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { mount, shallowMount } from '@vue/test-utils'; 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Table from '@/views/base/Table' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Table.vue', () => { 9 | it('has a name', () => { 10 | expect(Table.name).toMatch('c-table') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof Table.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof Table.data).toMatch('function') 17 | const defaultData = Table.data() 18 | expect(defaultData.currentPage).toBe(1) 19 | }) 20 | it('is Vue instance', () => { 21 | const wrapper = mount(Table) 22 | expect(wrapper.isVueInstance()).toBe(true) 23 | }) 24 | it('is Table', () => { 25 | const wrapper = mount(Table) 26 | expect(wrapper.is(Table)).toBe(true) 27 | }) 28 | it('should render correct content', () => { 29 | const wrapper = mount(Table) 30 | expect(wrapper.find('div.card-header > div').text()).toMatch('Table') 31 | }) 32 | test('renders correctly', () => { 33 | const wrapper = shallowMount(Table) 34 | expect(wrapper.element).toMatchSnapshot() 35 | }) 36 | }) 37 | -------------------------------------------------------------------------------- /tests/unit/views/base/Tables.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { mount, shallowMount } from '@vue/test-utils'; 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Tables from '@/views/base/Tables' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Tables.vue', () => { 9 | it('has a name', () => { 10 | expect(Tables.name).toMatch('tables') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = mount(Tables) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is Tables', () => { 17 | const wrapper = mount(Tables) 18 | expect(wrapper.is(Tables)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = mount(Tables) 22 | expect(wrapper.find('div.card-header > div').text()).toMatch('Simple Table') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = shallowMount(Tables) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/base/Tabs.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { mount, shallowMount } from '@vue/test-utils'; 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Tabs from '@/views/base/Tabs' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Tabs.vue', () => { 9 | it('has a name', () => { 10 | expect(Tabs.name).toMatch('tabs') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof Tabs.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof Tabs.data).toMatch('function') 17 | const defaultData = Tabs.data() 18 | expect(defaultData.tabs).toEqual(["Calculator", "Shopping cart", "Charts"]) 19 | expect(defaultData.tabIndex).toEqual([0, 0]) 20 | }) 21 | it('is Vue instance', () => { 22 | const wrapper = mount(Tabs) 23 | expect(wrapper.isVueInstance()).toBe(true) 24 | }) 25 | it('is Tabs', () => { 26 | const wrapper = mount(Tabs) 27 | expect(wrapper.is(Tabs)).toBe(true) 28 | }) 29 | it('should render correct content', () => { 30 | const wrapper = mount(Tabs) 31 | expect(wrapper.find('div.card-header > div').text()).toMatch('Tabs') 32 | }) 33 | test('renders correctly', () => { 34 | const wrapper = shallowMount(Tabs) 35 | expect(wrapper.element).toMatchSnapshot() 36 | }) 37 | }) 38 | -------------------------------------------------------------------------------- /tests/unit/views/base/Tooltips.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { mount, shallowMount } from '@vue/test-utils'; 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Tooltips from '@/views/base/Tooltips' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Tooltips.vue', () => { 9 | it('has a name', () => { 10 | expect(Tooltips.name).toMatch('tooltips') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof Tooltips.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof Tooltips.data).toMatch('function') 17 | const defaultData = Tooltips.data() 18 | expect(defaultData.show).toBe(true) 19 | expect(defaultData.disabled).toBe(false) 20 | }) 21 | it('is Vue instance', () => { 22 | const wrapper = shallowMount(Tooltips) 23 | expect(wrapper.isVueInstance()).toBe(true) 24 | }) 25 | it('is Tooltips', () => { 26 | const wrapper = shallowMount(Tooltips) 27 | expect(wrapper.is(Tooltips)).toBe(true) 28 | }) 29 | it('should render correct content', () => { 30 | const wrapper = mount(Tooltips) 31 | expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Tooltips') 32 | }) 33 | test('renders correctly', () => { 34 | const wrapper = shallowMount(Tooltips) 35 | expect(wrapper.element).toMatchSnapshot() 36 | }) 37 | it('should have methods', () => { 38 | const wrapper = mount(Tooltips) 39 | expect(typeof Tooltips.methods.onOpen).toEqual('function') 40 | expect(wrapper.vm.onOpen()).toBeUndefined() 41 | expect(typeof Tooltips.methods.onClose).toEqual('function') 42 | expect(wrapper.vm.onClose()).toBeUndefined() 43 | expect(typeof Tooltips.methods.disableByRef).toEqual('function') 44 | expect(wrapper.vm.disableByRef()).toBeUndefined() 45 | wrapper.vm.disabled = true 46 | expect(wrapper.vm.disableByRef()).toBeUndefined() 47 | }) 48 | }) 49 | -------------------------------------------------------------------------------- /tests/unit/views/base/__snapshots__/Breadcrumbs.spec.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Breadcrumbs.vue renders correctly 1`] = ` 4 |
7 |
10 |
13 |
16 |
19 |
22 |
23 | 26 | 27 | Bootstrap Breadcrumb 28 | 29 | 30 | 46 |
47 |
48 |
51 | 52 | 90 |
91 |
92 |
93 |
94 |
95 |
96 | `; 97 | -------------------------------------------------------------------------------- /tests/unit/views/base/__snapshots__/Paginations.spec.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Paginations.vue renders correctly 1`] = ` 4 |
7 |
10 | 18 |
21 | 24 | 25 | Bootstrap Pagination 26 | 27 | 28 | 44 |
45 | 46 |
47 |
48 | Default 49 |
50 | 51 | 56 | 57 |
58 | 59 |
60 | Small 61 |
62 | 63 | 68 | 69 |
70 | 71 |
74 |
75 | Large 76 |
77 | 78 | 83 | 84 |
85 |
86 | 87 |
88 | currentPage: 3 89 |
90 |
91 |
92 | 93 | 101 |
104 | 107 | 108 | Pagination 109 | 110 | 111 | 112 | alignment 113 | 114 |
115 | 116 |
117 |
118 | Left alignment (default) 119 |
120 | 121 | 125 | 126 |
127 | 128 |
129 | Center alignment 130 |
131 | 132 | 137 | 138 |
139 | 140 |
141 | Right (end) alignment 142 |
143 | 144 | 149 | 150 |
151 | 152 |
153 | currentPage: 3 154 |
155 |
156 |
157 | 158 | 166 |
169 | 172 | 173 | Pagination 174 | 175 | 176 | 177 | navigation 178 | 179 |
180 | 181 |
182 |
183 | Default 184 |
185 | 186 | 191 | 192 |
195 | With link generator function 196 |
197 | 198 | 204 | 205 |
206 | 207 |
210 | currentPage: 3 211 |
212 |
213 |
214 |
215 |
216 | `; 217 | -------------------------------------------------------------------------------- /tests/unit/views/base/__snapshots__/Table.spec.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Table.vue renders correctly 1`] = ` 4 | 13 | 29 | 30 | 39 | 40 | `; 41 | -------------------------------------------------------------------------------- /tests/unit/views/buttons/BrandButtons.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import BrandButtons from '@/views/buttons/BrandButtons' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('BrandButtons.vue', () => { 9 | it('has a name', () => { 10 | expect(BrandButtons.name).toMatch('brand-buttons') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(BrandButtons) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is BrandButtons', () => { 17 | const wrapper = shallowMount(BrandButtons) 18 | expect(wrapper.is(BrandButtons)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = mount(BrandButtons) 22 | expect(wrapper.find('div.card-header > div > strong').text()).toMatch('Brand Button') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = mount(BrandButtons) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/buttons/ButtonDropdowns.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Dropdowns from '@/views/buttons/Dropdowns' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Dropdowns.vue', () => { 9 | it('has a name', () => { 10 | expect(Dropdowns.name).toMatch('dropdowns') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(Dropdowns) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is Dropdowns', () => { 17 | const wrapper = shallowMount(Dropdowns) 18 | expect(wrapper.is(Dropdowns)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = mount(Dropdowns) 22 | expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Dropdown') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = mount(Dropdowns) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/buttons/ButtonGroups.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import ButtonGroups from '@/views/buttons/ButtonGroups' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('ButtonGroups.vue', () => { 9 | it('has a name', () => { 10 | expect(ButtonGroups.name).toMatch('button-groups') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(ButtonGroups) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is ButtonGroups', () => { 17 | const wrapper = shallowMount(ButtonGroups) 18 | expect(wrapper.is(ButtonGroups)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = mount(ButtonGroups) 22 | expect(wrapper.find('header.card-header').text()).toMatch('Bootstrap button group') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = mount(ButtonGroups) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/buttons/StandardButtons.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import StandardButtons from '@/views/buttons/StandardButtons' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('StandardButtons.vue', () => { 9 | it('has a name', () => { 10 | expect(StandardButtons.name).toMatch('standard-buttons') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof StandardButtons.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof StandardButtons.data).toMatch('function') 17 | const defaultData = StandardButtons.data() 18 | expect(defaultData.togglePress).toBe(false) 19 | }) 20 | it('is Vue instance', () => { 21 | const wrapper = shallowMount(StandardButtons) 22 | expect(wrapper.isVueInstance()).toBe(true) 23 | }) 24 | it('is StandardButtons', () => { 25 | const wrapper = shallowMount(StandardButtons) 26 | expect(wrapper.is(StandardButtons)).toBe(true) 27 | }) 28 | it('should render correct content', () => { 29 | const wrapper = mount(StandardButtons) 30 | expect(wrapper.find('div.card-header > strong').text()).toMatch('Standard buttons') 31 | expect(wrapper.find('div.card-header > div > strong').text()).toMatch('Toggle pressed state') 32 | }) 33 | test('renders correctly', () => { 34 | const wrapper = shallowMount(StandardButtons) 35 | expect(wrapper.element).toMatchSnapshot() 36 | }) 37 | }) 38 | -------------------------------------------------------------------------------- /tests/unit/views/icons/CoreUIIcons.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import CoreUIIcons from '@/views/icons/CoreUIIcons' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('CoreUIIcons.vue', () => { 9 | it('has a name', () => { 10 | expect(CoreUIIcons.name).toMatch('CoreUIIcons') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(CoreUIIcons) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is CoreUIIcons', () => { 17 | const wrapper = shallowMount(CoreUIIcons) 18 | expect(wrapper.is(CoreUIIcons)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = mount(CoreUIIcons) 22 | expect(wrapper.find('div.card-header').text()).toMatch('CoreUI Icons New') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = mount(CoreUIIcons) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/icons/Flags.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Flags from '@/views/icons/Flags' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Flags.vue', () => { 9 | it('has a name', () => { 10 | expect(Flags.name).toMatch('flags') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(Flags) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is Flags', () => { 17 | const wrapper = shallowMount(Flags) 18 | expect(wrapper.is(Flags)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = mount(Flags) 22 | expect(wrapper.find('div.card-header').text()).toMatch('Flags') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = shallowMount(Flags) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/icons/FontAwesome.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import FontAwesome from '@/views/icons/FontAwesome' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('FontAwesome.vue', () => { 9 | it('has a name', () => { 10 | expect(FontAwesome.name).toMatch('font-awesome') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(FontAwesome) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is FontAwesome', () => { 17 | const wrapper = shallowMount(FontAwesome) 18 | expect(wrapper.is(FontAwesome)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = mount(FontAwesome) 22 | expect(wrapper.find('div.card-header').text()).toMatch('50 New Icons in 4.7') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = shallowMount(FontAwesome) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/icons/SimpleLineIcons.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import SimpleLineIcons from '@/views/icons/SimpleLineIcons' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('SimpleLineIcons.vue', () => { 9 | it('has a name', () => { 10 | expect(SimpleLineIcons.name).toMatch('simple-line-icons') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(SimpleLineIcons) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is SimpleLineIcons', () => { 17 | const wrapper = shallowMount(SimpleLineIcons) 18 | expect(wrapper.is(SimpleLineIcons)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = mount(SimpleLineIcons) 22 | expect(wrapper.find('div.card-header').text()).toMatch('Simple Line Icons') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = shallowMount(SimpleLineIcons) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/notifications/Alerts.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Alerts from '@/views/notifications/Alerts' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Alerts.vue', () => { 9 | it('has a name', () => { 10 | expect(Alerts.name).toMatch('alerts') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof Alerts.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof Alerts.data).toMatch('function') 17 | const defaultData = Alerts.data() 18 | expect(defaultData.showDismissibleAlert).toBe(false) 19 | }) 20 | it('is Vue instance', () => { 21 | const wrapper = shallowMount(Alerts) 22 | expect(wrapper.isVueInstance()).toBe(true) 23 | }) 24 | it('is Alerts', () => { 25 | const wrapper = shallowMount(Alerts) 26 | expect(wrapper.is(Alerts)).toBe(true) 27 | }) 28 | it('should render correct content', () => { 29 | const wrapper = mount(Alerts) 30 | expect(wrapper.find('header.card-header > div').text()).toMatch('Bootstrap Alert docs') 31 | }) 32 | test('renders correctly', () => { 33 | const wrapper = mount(Alerts) 34 | expect(wrapper.element).toMatchSnapshot() 35 | }) 36 | it('should have methods', () => { 37 | expect(typeof Alerts.methods.showAlert ).toEqual('function') 38 | expect(Alerts.methods.showAlert()).toBeUndefined() 39 | expect(typeof Alerts.methods.countDownChanged ).toEqual('function') 40 | expect(Alerts.methods.countDownChanged(10)).toBeUndefined() 41 | }) 42 | }) 43 | -------------------------------------------------------------------------------- /tests/unit/views/notifications/Badges.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Badges from '@/views/notifications/Badges' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Badges.vue', () => { 9 | it('has a name', () => { 10 | expect(Badges.name).toMatch('badges') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(Badges) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is Badges', () => { 17 | const wrapper = shallowMount(Badges) 18 | expect(wrapper.is(Badges)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = mount(Badges) 22 | expect(wrapper.find('header.card-header > div').text()).toMatch('Bootstrap Badge docs') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = mount(Badges) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/notifications/Modals.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Modals from '@/views/notifications/Modals' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Modals.vue', () => { 9 | it('has a name', () => { 10 | expect(Modals.name).toMatch('modals') 11 | }) 12 | it('has a created hook', () => { 13 | expect(typeof Modals.data).toMatch('function') 14 | }) 15 | it('sets the correct default data', () => { 16 | expect(typeof Modals.data).toMatch('function') 17 | const defaultData = Modals.data() 18 | expect(defaultData.largeModal).toBe(false) 19 | }) 20 | it('is Vue instance', () => { 21 | const wrapper = shallowMount(Modals) 22 | expect(wrapper.isVueInstance()).toBe(true) 23 | }) 24 | it('is Modals', () => { 25 | const wrapper = shallowMount(Modals) 26 | expect(wrapper.is(Modals)).toBe(true) 27 | }) 28 | it('should render correct content', () => { 29 | const wrapper = mount(Modals) 30 | expect(wrapper.find('div.card-header > div').text()).toMatch('Bootstrap Modals') 31 | }) 32 | test('renders correctly', () => { 33 | const wrapper = shallowMount(Modals) 34 | expect(wrapper.element).toMatchSnapshot() 35 | }) 36 | }) 37 | -------------------------------------------------------------------------------- /tests/unit/views/pages/Login.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Login from '@/views/pages/Login' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Login.vue', () => { 9 | it('has a name', () => { 10 | expect(Login.name).toMatch('Login') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(Login) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is Login', () => { 17 | const wrapper = shallowMount(Login) 18 | expect(wrapper.is(Login)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = shallowMount(Login) 22 | expect(wrapper.find('h1').text()).toMatch('Login') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = shallowMount(Login) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/pages/Page404.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Page404 from '@/views/pages/Page404' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Page404.vue', () => { 9 | it('has a name', () => { 10 | expect(Page404.name).toMatch('Page404') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(Page404) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is Page500', () => { 17 | const wrapper = shallowMount(Page404) 18 | expect(wrapper.is(Page404)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = shallowMount(Page404) 22 | expect(wrapper.find('h1').text()).toMatch('404') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = shallowMount(Page404) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/pages/Page500.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Page500 from '@/views/pages/Page500' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Page500.vue', () => { 9 | it('has a name', () => { 10 | expect(Page500.name).toMatch('Page500') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(Page500) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is Page500', () => { 17 | const wrapper = shallowMount(Page500) 18 | expect(wrapper.is(Page500)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = shallowMount(Page500) 22 | expect(wrapper.find('h1').text()).toMatch('500') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = shallowMount(Page500) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/pages/Register.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Register from '@/views/pages/Register' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Register.vue', () => { 9 | it('has a name', () => { 10 | expect(Register.name).toMatch('Register') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(Register) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is Register', () => { 17 | const wrapper = shallowMount(Register) 18 | expect(wrapper.is(Register)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = shallowMount(Register) 22 | expect(wrapper.find('h1').text()).toMatch('Register') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = shallowMount(Register) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/pages/__snapshots__/Page404.spec.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Page404.vue renders correctly 1`] = ` 4 |
7 |
10 | 14 | 18 |
21 |

24 | 404 25 |

26 | 27 |

30 | Oops! You're lost. 31 |

32 | 33 |

36 | The page you are looking for was not found. 37 |

38 |
39 | 40 | 43 | 46 | 49 | 52 | 53 | 54 | 55 | 62 | 63 | 67 | 76 | Search 77 | 78 | 79 | 80 |
81 |
82 |
83 |
84 | `; 85 | -------------------------------------------------------------------------------- /tests/unit/views/pages/__snapshots__/Page500.spec.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Page500.vue renders correctly 1`] = ` 4 |
7 |
10 | 14 | 18 |
21 |

24 | 500 25 |

26 | 27 |

30 | Houston, we have a problem! 31 |

32 | 33 |

36 | The page you are looking for is temporarily unavailable. 37 |

38 |
39 | 40 | 43 | 46 | 49 | 52 | 53 | 54 | 55 | 62 | 63 | 67 | 76 | Search 77 | 78 | 79 | 80 |
81 |
82 |
83 |
84 | `; 85 | -------------------------------------------------------------------------------- /tests/unit/views/theme/Colors.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount, mount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Colors from '@/views/theme/Colors' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Colors.vue', () => { 9 | it('has a name', () => { 10 | expect(Colors.name).toMatch('colors') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(Colors) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is Colors', () => { 17 | const wrapper = shallowMount(Colors) 18 | expect(wrapper.is(Colors)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = mount(Colors) 22 | expect(wrapper.find('header.card-header > div').text()).toMatch('Theme colors') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = mount(Colors) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/theme/Typography.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { shallowMount } from '@vue/test-utils' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import Typography from '@/views/theme/Typography' 5 | 6 | Vue.use(BootstrapVue) 7 | 8 | describe('Typography.vue', () => { 9 | it('has a name', () => { 10 | expect(Typography.name).toMatch('typography') 11 | }) 12 | it('is Vue instance', () => { 13 | const wrapper = shallowMount(Typography) 14 | expect(wrapper.isVueInstance()).toBe(true) 15 | }) 16 | it('is Typography', () => { 17 | const wrapper = shallowMount(Typography) 18 | expect(wrapper.is(Typography)).toBe(true) 19 | }) 20 | it('should render correct content', () => { 21 | const wrapper = shallowMount(Typography) 22 | expect(wrapper.find('.card-header').text()).toMatch('Headings') 23 | }) 24 | test('renders correctly', () => { 25 | const wrapper = shallowMount(Typography) 26 | expect(wrapper.element).toMatchSnapshot() 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /tests/unit/views/users/User.spec.js: -------------------------------------------------------------------------------- 1 | import { shallowMount, mount, createLocalVue } from '@vue/test-utils' 2 | import VueRouter from 'vue-router' 3 | import BootstrapVue from 'bootstrap-vue' 4 | import User from '@/views/users/User' 5 | 6 | const localVue = createLocalVue() 7 | localVue.use(VueRouter) 8 | const router = new VueRouter() 9 | 10 | localVue.use(BootstrapVue) 11 | 12 | describe('User.vue', () => { 13 | it('has a name', () => { 14 | expect(User.name).toMatch('User') 15 | }) 16 | it('has a created hook', () => { 17 | expect(typeof User.data).toMatch('function') 18 | }) 19 | it('sets the correct default data', () => { 20 | expect(typeof User.data).toMatch('function') 21 | const defaultData = User.data() 22 | expect(defaultData.fields).toEqual([{key: 'key'}, {key: 'value'}]) 23 | }) 24 | it('is Vue instance', () => { 25 | const wrapper = shallowMount(User, { 26 | localVue, 27 | router 28 | }) 29 | expect(wrapper.isVueInstance()).toBe(true) 30 | }) 31 | it('is User', () => { 32 | const wrapper = shallowMount(User, { 33 | localVue, 34 | router 35 | }) 36 | expect(wrapper.is(User)).toBe(true) 37 | }) 38 | it('renders props.caption when passed', () => { 39 | const caption = 'User id:' 40 | const wrapper = mount(User, { 41 | propsData: { caption }, 42 | localVue, 43 | router 44 | }) 45 | expect(wrapper.find('div.card-header').text()).toMatch(caption) 46 | }) 47 | it('should have methods', () => { 48 | const wrapper = shallowMount(User,{ 49 | localVue, 50 | router 51 | }) 52 | 53 | expect(typeof User.methods.goBack ).toEqual('function') 54 | expect(wrapper.vm.goBack()).toBeUndefined() 55 | }) 56 | test('renders correctly', () => { 57 | const wrapper = shallowMount(User, { 58 | localVue, 59 | router 60 | }) 61 | expect(wrapper.element).toMatchSnapshot() 62 | }) 63 | }) 64 | -------------------------------------------------------------------------------- /tests/unit/views/users/Users.spec.js: -------------------------------------------------------------------------------- 1 | import { createLocalVue, shallowMount, mount } from '@vue/test-utils' 2 | import BootstrapVue from 'bootstrap-vue' 3 | import Users from '@/views/users/Users' 4 | import VueRouter from 'vue-router'; 5 | 6 | const localVue = createLocalVue() 7 | localVue.use(VueRouter) 8 | const router = new VueRouter() 9 | 10 | localVue.use(BootstrapVue) 11 | 12 | describe('Users.vue', () => { 13 | it('has a name', () => { 14 | expect(Users.name).toMatch('Users') 15 | }) 16 | it('has a created hook', () => { 17 | expect(typeof Users.data).toMatch('function') 18 | }) 19 | it('sets the correct default data', () => { 20 | expect(typeof Users.data).toMatch('function') 21 | const defaultData = Users.data() 22 | expect(defaultData.currentPage).toBe(1) 23 | }) 24 | it('is Vue instance', () => { 25 | const wrapper = shallowMount(Users,{ 26 | localVue, 27 | router 28 | }) 29 | expect(wrapper.isVueInstance()).toBe(true) 30 | }) 31 | it('is Users', () => { 32 | const wrapper = shallowMount(Users,{ 33 | localVue, 34 | router 35 | }) 36 | expect(wrapper.is(Users)).toBe(true) 37 | }) 38 | it('renders props.caption when passed', () => { 39 | const caption = 'Users List' 40 | const wrapper = mount(Users, { 41 | propsData: { caption }, 42 | localVue, 43 | router 44 | }) 45 | expect(wrapper.find('div.card-header > div').text()).toMatch(caption) 46 | }) 47 | test('renders correctly', () => { 48 | const wrapper = shallowMount(Users, { 49 | localVue, 50 | router 51 | }) 52 | expect(wrapper.element).toMatchSnapshot() 53 | }) 54 | it('should have methods', () => { 55 | const wrapper = shallowMount(Users,{ 56 | localVue, 57 | router 58 | }) 59 | 60 | expect(typeof Users.methods.userLink ).toEqual('function') 61 | expect(Users.methods.userLink(42)).toBe('users/42') 62 | expect(typeof Users.methods.rowClicked ).toEqual('function') 63 | expect(wrapper.vm.rowClicked({id:42})).toBeUndefined() 64 | }) 65 | }) 66 | -------------------------------------------------------------------------------- /tests/unit/views/users/__snapshots__/User.spec.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`User.vue renders correctly 1`] = ` 4 | 7 | 12 | 21 | 26 | 27 | 46 | 47 | 59 | 60 | 61 | 62 | `; 63 | -------------------------------------------------------------------------------- /tests/unit/views/users/__snapshots__/Users.spec.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Users.vue renders correctly 1`] = ` 4 | 7 | 12 | 22 | 40 | 41 | 51 | 52 | 53 | 54 | `; 55 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | lintOnSave: false, 3 | runtimeCompiler: true 4 | } 5 | --------------------------------------------------------------------------------