Skip to content

Commit

Permalink
Feature/integrate service workers to storybook (#1878)
Browse files Browse the repository at this point in the history
* #1870: Fix missing audit logs

* Integrate service workers to storybook

* Integrate service workers to storybook

* Integrate service workers to storybook

* Integrate service workers to storybook
  • Loading branch information
ulischulte committed Dec 10, 2021
1 parent 9f75816 commit c775206
Show file tree
Hide file tree
Showing 8 changed files with 707 additions and 3 deletions.
18 changes: 16 additions & 2 deletions spring-boot-admin-server-ui/.storybook/preview.js
Expand Up @@ -5,10 +5,17 @@ import Vue from "vue/dist/vue.js";
import components from "@/components";
import i18n from "@/i18n";
import VueI18n from "vue-i18n";
import mappingsEndpoint from '@/mocks/instance/mappings';

import { initialize, mswDecorator } from 'msw-storybook-addon';

// Initialize MSW
initialize();

Vue.use(VueI18n);
Vue.use(components);


export const parameters = {
actions: {argTypesRegex: "^on[A-Z].*"},
controls: {
Expand All @@ -17,6 +24,12 @@ export const parameters = {
date: /Date$/,
},
},
msw: {
handlers: {
auth: null,
others: [...mappingsEndpoint]
}
}
}

export const decorators = [
Expand All @@ -25,7 +38,8 @@ export const decorators = [
return Vue.extend({
i18n,
components: {wrapped},
template: `<wrapped/>`
template: `
<wrapped/>`
})
},
}, mswDecorator
]
24 changes: 24 additions & 0 deletions spring-boot-admin-server-ui/package-lock.json

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

6 changes: 5 additions & 1 deletion spring-boot-admin-server-ui/package.json
Expand Up @@ -8,7 +8,7 @@
"lint": "vue-cli-service lint",
"lint:fix": "vue-cli-service lint --fix",
"watch": "vue-cli-service build --watch",
"storybook": "start-storybook -p 6006",
"storybook": "start-storybook -p 6006 -s public",
"build-storybook": "build-storybook"
},
"engines": {
Expand Down Expand Up @@ -81,6 +81,7 @@
"jest-each": "26.6.2",
"jest-environment-jsdom-sixteen": "2.0.0",
"msw": "0.35.0",
"msw-storybook-addon": "1.5.0",
"node-sass": "6.0.1",
"sass-loader": "10.2.0",
"style-loader": "1.3.0",
Expand Down Expand Up @@ -168,5 +169,8 @@
"**/*.spec.js"
],
"testURL": "http://example.com"
},
"msw": {
"workerDirectory": "public"
}
}

0 comments on commit c775206

Please sign in to comment.