Skip to content

Commit

Permalink
chore: code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
helmuthdu committed Feb 24, 2019
1 parent c6e1050 commit 89379ea
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 215 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -12,7 +12,7 @@
"test:unit": "vue-cli-service test:unit"
},
"dependencies": {
"@mdi/font": "^3.4.93",
"@mdi/font": "^3.5.94",
"axios": "^0.18.0",
"buefy": "^0.7.2",
"kaop-ts": "^4.1.1",
Expand All @@ -36,7 +36,7 @@
"@storybook/vue": "^4.1.13",
"@types/jest": "^24.0.6",
"@types/lodash": "^4.14.121",
"@types/node": "^11.9.4",
"@types/node": "^11.9.5",
"@vue/cli-plugin-babel": "^3.4.1",
"@vue/cli-plugin-e2e-cypress": "^3.4.1",
"@vue/cli-plugin-pwa": "^3.4.1",
Expand All @@ -47,13 +47,13 @@
"axios-mock-adapter": "^1.16.0",
"babel-core": "7.0.0-bridge.0",
"cypress-testing-library": "^2.3.6",
"fibers": "^3.1.1",
"jest-watch-typeahead": "^0.2.1",
"lint-staged": "^8.1.4",
"prettier": "^1.16.4",
"storybook-readme": "^4.0.5",
"fibers": "^3.1.1",
"sass": "^1.17.1",
"sass": "^1.17.2",
"sass-loader": "^7.1.0",
"storybook-readme": "^4.0.5",
"ts-jest": "^24.0.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "^3.3.3333",
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/search.helper.ts
@@ -1,5 +1,5 @@
import { Observable, SchedulerLike } from 'rxjs';
import { debounceTime, distinctUntilChanged, pluck, startWith, filter } from 'rxjs/operators';
import { debounceTime, distinctUntilChanged, filter, pluck, startWith } from 'rxjs/operators';
import { WatchObservable } from 'vue-rx';

interface SearchObservableOptions {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks.ts
Expand Up @@ -6,5 +6,5 @@ Component.registerHooks([
'beforeRouteEnter',
'beforeRouteLeave',
'beforeRouteUpdate', // for vue-router 2.2+
'subscriptions' // for vue-rx
'subscriptions', // for vue-rx
]);
278 changes: 96 additions & 182 deletions src/layouts/__tests__/__snapshots__/default.layout.test.ts.snap
@@ -1,186 +1,100 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`About route component should renders with props 1`] = `
<v-app-stub id="inspire">
<v-navigation-drawer-stub fixed="true" app="true" clipped="true" height="100%" minivariantwidth="80" mobilebreakpoint="1264" width="300">
<v-list-stub dense="true">
<v-list-tile-stub activeclass="primary--text" exact="true" to="/">
<v-list-tile-action-stub>
<v-icon-stub>contacts</v-icon-stub>
</v-list-tile-action-stub>
<v-list-tile-content-stub>
<v-list-tile-title-stub> Contacts </v-list-tile-title-stub>
</v-list-tile-content-stub>
</v-list-tile-stub>
<v-list-tile-stub activeclass="primary--text" exact="true">
<v-list-tile-action-stub>
<v-icon-stub>history</v-icon-stub>
</v-list-tile-action-stub>
<v-list-tile-content-stub>
<v-list-tile-title-stub> Frequently contacted </v-list-tile-title-stub>
</v-list-tile-content-stub>
</v-list-tile-stub>
<v-list-tile-stub activeclass="primary--text" exact="true">
<v-list-tile-action-stub>
<v-icon-stub>content_copy</v-icon-stub>
</v-list-tile-action-stub>
<v-list-tile-content-stub>
<v-list-tile-title-stub> Duplicates </v-list-tile-title-stub>
</v-list-tile-content-stub>
</v-list-tile-stub>
<v-list-group-stub value="true" activeclass="primary--text" appendicon="" prependicon="keyboard_arrow_up">
<v-list-tile-stub activeclass="primary--text">
<v-list-tile-content-stub>
<v-list-tile-title-stub> Labels </v-list-tile-title-stub>
</v-list-tile-content-stub>
</v-list-tile-stub>
<v-list-tile-stub activeclass="primary--text">
<v-list-tile-action-stub>
<v-icon-stub>add</v-icon-stub>
</v-list-tile-action-stub>
<v-list-tile-content-stub>
<v-list-tile-title-stub> Create label </v-list-tile-title-stub>
</v-list-tile-content-stub>
</v-list-tile-stub>
</v-list-group-stub>
<v-list-group-stub activeclass="primary--text" appendicon="" prependicon="keyboard_arrow_down">
<v-list-tile-stub activeclass="primary--text">
<v-list-tile-content-stub>
<v-list-tile-title-stub> More </v-list-tile-title-stub>
</v-list-tile-content-stub>
</v-list-tile-stub>
<v-list-tile-stub activeclass="primary--text">
<!---->
<v-list-tile-content-stub>
<v-list-tile-title-stub> Import </v-list-tile-title-stub>
</v-list-tile-content-stub>
</v-list-tile-stub>
<v-list-tile-stub activeclass="primary--text">
<!---->
<v-list-tile-content-stub>
<v-list-tile-title-stub> Export </v-list-tile-title-stub>
</v-list-tile-content-stub>
</v-list-tile-stub>
<v-list-tile-stub activeclass="primary--text">
<!---->
<v-list-tile-content-stub>
<v-list-tile-title-stub> Print </v-list-tile-title-stub>
</v-list-tile-content-stub>
</v-list-tile-stub>
<v-list-tile-stub activeclass="primary--text">
<!---->
<v-list-tile-content-stub>
<v-list-tile-title-stub> Undo changes </v-list-tile-title-stub>
</v-list-tile-content-stub>
</v-list-tile-stub>
<v-list-tile-stub activeclass="primary--text">
<!---->
<v-list-tile-content-stub>
<v-list-tile-title-stub> Other contacts </v-list-tile-title-stub>
</v-list-tile-content-stub>
</v-list-tile-stub>
</v-list-group-stub>
<v-list-tile-stub activeclass="primary--text" exact="true">
<v-list-tile-action-stub>
<v-icon-stub>settings</v-icon-stub>
</v-list-tile-action-stub>
<v-list-tile-content-stub>
<v-list-tile-title-stub> Settings </v-list-tile-title-stub>
</v-list-tile-content-stub>
</v-list-tile-stub>
<v-list-tile-stub activeclass="primary--text" exact="true">
<v-list-tile-action-stub>
<v-icon-stub>chat_bubble</v-icon-stub>
</v-list-tile-action-stub>
<v-list-tile-content-stub>
<v-list-tile-title-stub> Send feedback </v-list-tile-title-stub>
</v-list-tile-content-stub>
</v-list-tile-stub>
<v-list-tile-stub activeclass="primary--text" exact="true" to="/about">
<v-list-tile-action-stub>
<v-icon-stub>help</v-icon-stub>
</v-list-tile-action-stub>
<v-list-tile-content-stub>
<v-list-tile-title-stub> Help </v-list-tile-title-stub>
</v-list-tile-content-stub>
</v-list-tile-stub>
<v-list-tile-stub activeclass="primary--text" exact="true">
<v-list-tile-action-stub>
<v-icon-stub>phonelink</v-icon-stub>
</v-list-tile-action-stub>
<v-list-tile-content-stub>
<v-list-tile-title-stub> App downloads </v-list-tile-title-stub>
</v-list-tile-content-stub>
</v-list-tile-stub>
<v-list-tile-stub activeclass="primary--text" exact="true">
<v-list-tile-action-stub>
<v-icon-stub>keyboard</v-icon-stub>
</v-list-tile-action-stub>
<v-list-tile-content-stub>
<v-list-tile-title-stub> Go to the old version </v-list-tile-title-stub>
</v-list-tile-content-stub>
</v-list-tile-stub>
</v-list-stub>
</v-navigation-drawer-stub>
<v-toolbar-stub fixed="true" app="true" color="blue darken-3" dark="true" scrollthreshold="300">
<v-toolbar-title-stub>
<v-toolbar-side-icon-stub></v-toolbar-side-icon-stub> <span class="hidden-sm-and-down"></span>
</v-toolbar-title-stub>
<v-text-field-stub flat="" solo-inverted="" hide-details="" prepend-inner-icon="search" label="Search" class="hidden-sm-and-down"></v-text-field-stub>
<v-spacer-stub></v-spacer-stub>
<v-btn-stub activeclass="v-btn--active" tag="button" icon="true" type="button">
<v-icon-stub>apps</v-icon-stub>
</v-btn-stub>
<v-btn-stub activeclass="v-btn--active" tag="button" icon="true" type="button">
<v-icon-stub>notifications</v-icon-stub>
</v-btn-stub>
<v-btn-stub activeclass="v-btn--active" tag="button" icon="true" large="true" type="button">
<v-avatar-stub size="32px" tile="true"><img src="https://cdn.vuetifyjs.com/images/logos/logo.svg" alt="Vuetify"></v-avatar-stub>
</v-btn-stub>
</v-toolbar-stub>
<v-content-stub tag="main">
<v-container-stub tag="div" fluid="" fill-height="">
<router-view-stub name="default"></router-view-stub>
</v-container-stub>
</v-content-stub>
<v-btn-stub color="pink" activeclass="v-btn--active" tag="button" bottom="true" fixed="true" right="true" dark="true" fab="true" type="button">
<v-icon-stub>add</v-icon-stub>
</v-btn-stub>
<v-dialog-stub contentclass="" maxwidth="none" origin="center center" width="800px" transition="dialog-transition">
<v-card-stub tag="div">
<v-card-title-stub class="grey lighten-4 py-4 title"> Create contact </v-card-title-stub>
<v-container-stub tag="div" grid-list-sm="" class="pa-4">
<v-layout-stub tag="div" row="" wrap="">
<v-flex-stub tag="div" xs12="" align-center="" justify-space-between="">
<v-layout-stub tag="div" align-center="">
<v-avatar-stub size="40px" class="mr-3"><img src="//ssl.gstatic.com/s2/oz/images/sge/grey_silhouette.png" alt=""></v-avatar-stub>
<v-text-field-stub placeholder="Name"></v-text-field-stub>
</v-layout-stub>
</v-flex-stub>
<v-flex-stub tag="div" xs6="">
<v-text-field-stub prepend-icon="business" placeholder="Company"></v-text-field-stub>
</v-flex-stub>
<v-flex-stub tag="div" xs6="">
<v-text-field-stub placeholder="Job title"></v-text-field-stub>
</v-flex-stub>
<v-flex-stub tag="div" xs12="">
<v-text-field-stub prepend-icon="mail" placeholder="Email"></v-text-field-stub>
</v-flex-stub>
<v-flex-stub tag="div" xs12="">
<v-text-field-stub type="tel" prepend-icon="phone" placeholder="(000) 000 - 0000" mask="phone"></v-text-field-stub>
</v-flex-stub>
<v-flex-stub tag="div" xs12="">
<v-text-field-stub prepend-icon="notes" placeholder="Notes"></v-text-field-stub>
</v-flex-stub>
</v-layout-stub>
</v-container-stub>
<v-card-actions-stub>
<v-btn-stub color="primary" activeclass="v-btn--active" tag="button" flat="true" type="button">More</v-btn-stub>
<v-spacer-stub></v-spacer-stub>
<v-btn-stub color="primary" activeclass="v-btn--active" tag="button" flat="true" type="button">Cancel</v-btn-stub>
<v-btn-stub activeclass="v-btn--active" tag="button" flat="true" type="button">Save</v-btn-stub>
</v-card-actions-stub>
</v-card-stub>
</v-dialog-stub>
</v-app-stub>
<div>
<section class="hero is-medium is-primary">
<div class="hero-body">
<div class="container">
<div class="columns">
<div class="column is-8-desktop is-offset-2-desktop">
<h1 class="title is-2 is-spaced">
Hello Bulma!
</h1>
<h2 class="subtitle is-4">
Congratulations! You're running the <strong>Bulma start</strong> project.
<br>
It includes everything you need to <strong>build your own website</strong> with Bulma.
</h2>
</div>
</div>
</div>
</div>
</section>
<section class="section">
<div class="container">
<div class="columns">
<div class="column is-8-desktop is-offset-2-desktop">
<div class="content">
<h3>What's included</h3>
<p>The <code>npm</code> dependencies included in <code>package.json</code> are:</p>
<ul>
<li><code><a href="https://github.com/jgthms/bulma">bulma</a></code></li>
<li><code><a href="https://github.com/sass/node-sass">node-sass</a></code> to compile your own Sass file
</li>
<li><code><a href="https://github.com/postcss/postcss-cli">postcss-cli</a></code> and
<code><a href="https://github.com/postcss/autoprefixer">autoprefixer</a></code> to add support for
older browsers
</li>
<li><code><a href="https://babeljs.io/docs/usage/cli/">babel-cli</a></code>,
<code><a href="https://github.com/babel/babel-preset-env">babel-preset-env</a></code>
and
<code><a href="https://github.com/jmcriffey/babel-preset-es2015-ie">babel-preset-es2015-ie</a></code>
for compiling ES6 JavaScript files
</li>
</ul>
<router-view-stub name="default"></router-view-stub>
</div>
<table class="table is-bordered is-fullwidth">
<thead>
<tr>
<th>Type</th>
<th>CSS class</th>
</tr>
</thead>
<tbody>
<tr>
<th>Columns</th>
<td><code><a href="http://bulma.io/documentation/columns/basics">columns</a></code> <code><a href="http://bulma.io/documentation/columns/basics">column</a></code></td>
</tr>
<tr>
<th>Layout</th>
<td><code><a href="http://bulma.io/documentation/layout/section">section</a></code> <code><a href="http://bulma.io/documentation/layout/container">container</a></code> <code><a href="http://bulma.io/documentation/layout/footer">footer</a></code></td>
</tr>
<tr>
<th>Elements</th>
<td><code><a href="http://bulma.io/documentation/elements/button">button</a></code> <code><a href="http://bulma.io/documentation/elements/content">content</a></code> <code><a href="http://bulma.io/documentation/elements/title">title</a></code> <code><a href="http://bulma.io/documentation/elements/title">subtitle</a></code></td>
</tr>
<tr>
<th>Form</th>
<td><code><a href="http://bulma.io/documentation/form/general">field</a></code> <code><a href="http://bulma.io/documentation/form/general">control</a></code></td>
</tr>
<tr>
<th>Helpers</th>
<td><code><a href="http://bulma.io/documentation/modifiers/typography-helpers/">has-text-centered</a></code> <code><a href="http://bulma.io/documentation/modifiers/typography-helpers/">has-text-weight-semibold</a></code></td>
</tr>
</tbody>
</table>
<div class="content">
<p>If you want to <strong>learn more</strong>, follow these links:</p>
</div>
<div class="field is-grouped">
<p class="control"><a href="http://bulma.io" class="button is-medium is-primary"><strong class="has-text-weight-semibold">Bulma homepage</strong></a></p>
<p class="control"><a href="http://bulma.io/documentation/overview/start/" class="button is-medium is-link"><strong class="has-text-weight-semibold">Documentation</strong></a></p>
</div>
</div>
</div>
</div>
</section>
<footer class="footer has-text-centered">
<div class="container">
<div class="columns">
<div class="column is-8-desktop is-offset-2-desktop">
<p><strong class="has-text-weight-semibold"><a href="https://www.npmjs.com/package/bulma-start">bulma-start@0.0.3</a></strong></p>
<p><small> Source code licensed <a href="http://opensource.org/licenses/mit-license.php">MIT</a></small></p>
<p style="margin-top: 1rem;"><a href="http://bulma.io"><img src="made-with-bulma.png" alt="Made with Bulma" width="128" height="24"></a></p>
</div>
</div>
</div>
</footer>
</div>
`;
8 changes: 3 additions & 5 deletions src/layouts/__tests__/default.layout.test.ts
@@ -1,14 +1,12 @@
import DefaultLayout from '../default.layout.vue';
import { createLocalVue, shallowMount, Wrapper } from '@vue/test-utils';
import Vuetify from 'vuetify';
import VueRouter from 'vue-router';
import DefaultLayout from '../default.layout.vue';

const localVue = createLocalVue();
localVue.use(VueRouter);
localVue.use(Vuetify);

const router = new VueRouter();

localVue.use(VueRouter);

describe('About route component', () => {
let wrapper: Wrapper<DefaultLayout>;

Expand Down

0 comments on commit 89379ea

Please sign in to comment.