-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Storybook snapshots for Web Analytics and Web Vitals (#27709)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
Showing
36 changed files
with
14,342 additions
and
20 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+18.2 KB
...snapshots__/queries-webvitalspathbreakdown--web-vitals-path-breakdown--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+18.2 KB
...napshots__/queries-webvitalspathbreakdown--web-vitals-path-breakdown--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+76.2 KB
frontend/__snapshots__/scenes-app-web-analytics--web-analytics-dashboard--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+77.6 KB
...tend/__snapshots__/scenes-app-web-analytics--web-analytics-dashboard--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+76.2 KB
frontend/__snapshots__/web-analytics-dashboard--web-analytics-dashboard--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+77.6 KB
frontend/__snapshots__/web-analytics-dashboard--web-analytics-dashboard--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.5 KB
frontend/__snapshots__/web-analytics-tiles--referrer-domain--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.7 KB
frontend/__snapshots__/web-analytics-tiles--referrer-domain--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
frontend/src/queries/nodes/WebVitals/WebVitals.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { Meta, StoryFn, StoryObj } from '@storybook/react' | ||
|
||
import { mswDecorator } from '~/mocks/browser' | ||
import { examples } from '~/queries/examples' | ||
import { Query } from '~/queries/Query/Query' | ||
|
||
import webVitals from './__mocks__/WebVitals.json' | ||
import webVitalsTrends from './__mocks__/WebVitalsTrends.json' | ||
|
||
type Story = StoryObj<typeof Query> | ||
const meta: Meta<typeof Query> = { | ||
title: 'Queries/WebVitals', | ||
component: Query, | ||
parameters: { | ||
layout: 'fullscreen', | ||
viewMode: 'story', | ||
testOptions: { | ||
waitForLoadersToDisappear: true, | ||
waitForSelector: '[data-attr=trend-line-graph] > canvas', | ||
}, | ||
}, | ||
decorators: [ | ||
mswDecorator({ | ||
post: { | ||
'/api/environments/:team_id/query/': (req) => { | ||
if ((req.body as any).query.kind === 'WebVitalsQuery') { | ||
return [200, webVitals] | ||
} else if ((req.body as any).query.kind === 'TrendsQuery') { | ||
return [200, webVitalsTrends] | ||
} | ||
}, | ||
}, | ||
}), | ||
], | ||
} | ||
export default meta | ||
|
||
// NOTE: See InsightCard.scss to see why we need this wrapper | ||
const QueryTemplate: StoryFn<typeof Query> = (args) => { | ||
return ( | ||
<div className="WebAnalyticsDashboard"> | ||
<div className="InsightVizDisplay"> | ||
<Query {...args} /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export const WebVitals: Story = QueryTemplate.bind({}) | ||
WebVitals.args = { query: examples['WebVitals'] } |
34 changes: 34 additions & 0 deletions
34
frontend/src/queries/nodes/WebVitals/WebVitalsPathBreakdown.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Meta, StoryFn, StoryObj } from '@storybook/react' | ||
|
||
import { mswDecorator } from '~/mocks/browser' | ||
import { examples } from '~/queries/examples' | ||
import { Query } from '~/queries/Query/Query' | ||
|
||
import webVitalsPathBreakdown from './__mocks__/WebVitalsPathBreakdown.json' | ||
|
||
type Story = StoryObj<typeof Query> | ||
const meta: Meta<typeof Query> = { | ||
title: 'Queries/WebVitalsPathBreakdown', | ||
component: Query, | ||
parameters: { | ||
layout: 'fullscreen', | ||
viewMode: 'story', | ||
}, | ||
decorators: [ | ||
mswDecorator({ | ||
post: { | ||
'/api/environments/:team_id/query/': (req) => { | ||
if ((req.body as any).query.kind === 'WebVitalsPathBreakdownQuery') { | ||
return [200, webVitalsPathBreakdown] | ||
} | ||
}, | ||
}, | ||
}), | ||
], | ||
} | ||
export default meta | ||
|
||
const QueryTemplate: StoryFn<typeof Query> = (args) => <Query {...args} /> | ||
|
||
export const WebVitalsPathBreakdown: Story = QueryTemplate.bind({}) | ||
WebVitalsPathBreakdown.args = { query: examples['WebVitalsPathBreakdown'] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.