Skip to content

Commit

Permalink
Add a single "Loading" state scenario for a generic KMW tile component.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmymadon committed Oct 8, 2024
1 parent 4a7abed commit 52cb130
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions assets/js/components/KeyMetrics/MetricTileNumeric.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,21 @@ Loading.args = {
previousValue: 0,
loading: true,
};
// Since the "Loading" state is the same for all KMW tiles, this is the sole scenario
// and should not be added to any other generic `MetricTile___` or KMW component.
Loading.scenario = {
label: 'KeyMetrics/MetricTileNumeric/Loading',
};
Loading.decorators = [
( Story ) => {
// Ensure the animation is paused for VRT tests to correctly capture the loading state.
return (
<div className="googlesitekit-vrt-animation-paused">
<Story />
</div>
);
},
];

export default {
title: 'Key Metrics/WidgetTiles/MetricTileNumeric',
Expand Down

0 comments on commit 52cb130

Please sign in to comment.