Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(ui): App - add meta change case
Browse files Browse the repository at this point in the history
vio committed Nov 3, 2024
1 parent a8dccc3 commit 0521223
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions packages/ui/src/app/app.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import { createJobs } from '@bundle-stats/utils';
import merge from 'lodash/merge';

/* eslint-disable import/no-unresolved, import/no-relative-packages */
import currentData from '../../../../fixtures/job.current';
@@ -76,6 +77,39 @@ export const NoInsights: Story = {
),
};

export const AssetMetaChanges: Story = {
render: (args) => {
const current = merge({}, CURRENT_SOURCE);
const baseline = merge({}, CURRENT_SOURCE);

current.webpack.assets.push({
name: 'assets/js/vendors-auth.1a278dc.js',
size: 26364,
});
current.webpack.chunks.push({
id: 100,
entry: false,
initial: false,
files: ['assets/js/vendors-auth.1a278dc.js'],
names: ['vendors-auth'],
});

baseline.webpack.assets.push({
name: 'assets/js/vendors-auth.1a278dc.js',
size: 26364,
});
baseline.webpack.chunks.push({
id: 100,
entry: false,
initial: true,
files: ['assets/js/vendors-auth.1a278dc.js'],
names: ['vendors-auth'],
});

return <App jobs={createJobs([current, baseline])} {...args} />;
},
};

export const NoBaseline: Story = {
render: (args) => <App jobs={createJobs[CURRENT_SOURCE]} {...args} />,

Check warning

Code scanning / CodeQL

Implicit operand conversion Warning

This expression will be implicitly converted from object or undefined to string.
};

0 comments on commit 0521223

Please sign in to comment.