Skip to content

Commit

Permalink
Merge pull request #27365 from storybookjs/docs_fix_msw_snippets
Browse files Browse the repository at this point in the history
Docs: Fix MSW snippets
(cherry picked from commit d5a20ab)
  • Loading branch information
jonniebigodes authored and storybook-bot committed May 27, 2024
1 parent 9ebc042 commit 351f9af
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const MockedSuccess: Story = {
msw: {
handlers: [
graphql.query('AllInfoQuery', () => {
return new HttpResponse.json({
return HttpResponse.json({
data: {
allInfo: {
...TestData,
Expand All @@ -76,7 +76,7 @@ export const MockedError: Story = {
handlers: [
graphql.query('AllInfoQuery', async () => {
await delay(800);
return new HttpResponse.json({
return HttpResponse.json({
errors: [
{
message: 'Access denied',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const MockedSuccess: Story = {
msw: {
handlers: [
http.get('https://your-restful-endpoint/', () => {
return new HttpResponse.json(TestData);
return HttpResponse.json(TestData);
}),
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const MockedSuccess = {
msw: {
handlers: [
http.get('https://your-restful-endpoint/', () => {
return new HttpResponse.json(TestData);
return HttpResponse.json(TestData);
}),
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const MockedSuccess: Story = {
msw: {
handlers: [
http.get('https://your-restful-endpoint/', () => {
return new HttpResponse.json(TestData);
return HttpResponse.json(TestData);
}),
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const MockedSuccess: Story = {
msw: {
handlers: [
http.get('https://your-restful-endpoint/', () => {
return new HttpResponse.json(TestData);
return HttpResponse.json(TestData);
}),
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const MockedSuccess = {
msw: {
handlers: [
graphql.query('AllInfoQuery', () => {
return new HttpResponse.json({
return HttpResponse.json({
data: {
allInfo: {
...TestData,
Expand All @@ -80,7 +80,7 @@ export const MockedError = {
handlers: [
graphql.query('AllInfoQuery', async () => {
await delay(800);
return new HttpResponse.json({
return HttpResponse.json({
errors: [
{
message: 'Access denied',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const MockedSuccess: Story = {
msw: {
handlers: [
graphql.query('AllInfoQuery', () => {
return new HttpResponse.json({
return HttpResponse.json({
data: {
allInfo: {
...TestData,
Expand All @@ -84,7 +84,7 @@ export const MockedError: Story = {
handlers: [
graphql.query('AllInfoQuery', async () => {
await delay(800);
return new HttpResponse.json({
return HttpResponse.json({
errors: [
{
message: 'Access denied',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const MockedSuccess: Story = {
msw: {
handlers: [
graphql.query('AllInfoQuery', () => {
return new HttpResponse.json({
return HttpResponse.json({
data: {
allInfo: {
...TestData,
Expand All @@ -84,7 +84,7 @@ export const MockedError: Story = {
handlers: [
graphql.query('AllInfoQuery', async () => {
await delay(800);
return new HttpResponse.json({
return HttpResponse.json({
errors: [
{
message: 'Access denied',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const MockedSuccess = {
msw: {
handlers: [
graphql.query('AllInfoQuery', () => {
return new HttpResponse.json({
return HttpResponse.json({
data: {
allInfo: {
...TestData,
Expand All @@ -59,7 +59,7 @@ export const MockedError = {
handlers: [
graphql.query('AllInfoQuery', async () => {
await delay(800);
return new HttpResponse.json({
return HttpResponse.json({
errors: [
{
message: 'Access denied',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const MockedSuccess: Story = {
msw: {
handlers: [
graphql.query('AllInfoQuery', () => {
return new HttpResponse.json({
return HttpResponse.json({
data: {
allInfo: {
...TestData,
Expand All @@ -64,7 +64,7 @@ export const MockedError: Story = {
handlers: [
graphql.query('AllInfoQuery', async () => {
await delay(800);
return new HttpResponse.json({
return HttpResponse.json({
errors: [
{
message: 'Access denied',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const MockedSuccess: Story = {
msw: {
handlers: [
graphql.query('AllInfoQuery', () => {
return new HttpResponse.json({
return HttpResponse.json({
data: {
allInfo: {
...TestData,
Expand All @@ -64,7 +64,7 @@ export const MockedError: Story = {
handlers: [
graphql.query('AllInfoQuery', async () => {
await delay(800);
return new HttpResponse.json({
return HttpResponse.json({
errors: [
{
message: 'Access denied',
Expand Down
4 changes: 2 additions & 2 deletions docs/snippets/vue/msw-addon-configure-handlers-graphql.js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const MockedSuccess = {
msw: {
handlers: [
graphql.query('AllInfoQuery', () => {
return new HttpResponse.json({
return HttpResponse.json({
data: {
allInfo: {
...TestData,
Expand All @@ -62,7 +62,7 @@ export const MockedError = {
handlers: [
graphql.query('AllInfoQuery', async () => {
await delay(800);
return new HttpResponse.json({
return HttpResponse.json({
errors: [
{
message: 'Access denied',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const MockedSuccess: Story = {
msw: {
handlers: [
graphql.query('AllInfoQuery', () => {
return new HttpResponse.json({
return HttpResponse.json({
data: {
allInfo: {
...TestData,
Expand All @@ -67,7 +67,7 @@ export const MockedError: Story = {
handlers: [
graphql.query('AllInfoQuery', async () => {
await delay(800);
return new HttpResponse.json({
return HttpResponse.json({
errors: [
{
message: 'Access denied',
Expand Down
4 changes: 2 additions & 2 deletions docs/snippets/vue/msw-addon-configure-handlers-graphql.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const MockedSuccess: Story = {
msw: {
handlers: [
graphql.query('AllInfoQuery', () => {
return new HttpResponse.json({
return HttpResponse.json({
data: {
allInfo: {
...TestData,
Expand All @@ -67,7 +67,7 @@ export const MockedError: Story = {
handlers: [
graphql.query('AllInfoQuery', async () => {
await delay(800);
return new HttpResponse.json({
return HttpResponse.json({
errors: [
{
message: 'Access denied',
Expand Down
6 changes: 3 additions & 3 deletions docs/snippets/vue/storybook-preview-use-global-type.3.js.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
```js
// .storybook/preview.js

import { setup } from "@storybook/vue3";
import { setup } from '@storybook/vue3';

import { VApp } from "vuetify/components";
import { VApp } from 'vuetify/components';

import { registerPlugins } from "../src/plugins";
import { registerPlugins } from '../src/plugins';

setup((app) => {
// Registers your app's plugins including Vuetify into Storybook
Expand Down
8 changes: 4 additions & 4 deletions docs/snippets/vue/storybook-preview-use-global-type.3.ts.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
```ts
// .storybook/preview.ts

import type { Preview } from "@storybook/vue3";
import { setup } from "@storybook/vue3";
import type { Preview } from '@storybook/vue3';
import { setup } from '@storybook/vue3';

import { VApp } from "vuetify/components";
import { VApp } from 'vuetify/components';

import { registerPlugins } from "../src/plugins";
import { registerPlugins } from '../src/plugins';

setup((app) => {
// Registers your app's plugins including Vuetify into Storybook
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
```ts
// .storybook/preview.ts

import type { Preview } from "@storybook/vue3";
import { setup } from "@storybook/vue3";
import type { Preview } from '@storybook/vue3';
import { setup } from '@storybook/vue3';

import { VApp } from "vuetify/components";
import { VApp } from 'vuetify/components';

import { registerPlugins } from "../src/plugins";
import { registerPlugins } from '../src/plugins';

setup((app) => {
// Registers your app's plugins including Vuetify into Storybook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const MockedSuccess = {
msw: {
handlers: [
http.get('https://your-restful-endpoint/', () => {
return new HttpResponse.json(TestData);
return HttpResponse.json(TestData);
}),
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const MockedSuccess: Story = {
msw: {
handlers: [
http.get('https://your-restful-endpoint/', () => {
return new HttpResponse.json(TestData);
return HttpResponse.json(TestData);
}),
],
},
Expand Down

0 comments on commit 351f9af

Please sign in to comment.