Skip to content

Commit

Permalink
Merge pull request #24966 from storybookjs/tom/fix-double-action
Browse files Browse the repository at this point in the history
Test: Don't attach action to function mock if action was added already
  • Loading branch information
JReinhold authored Nov 24, 2023
2 parents 602f443 + 56c4550 commit b005c19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/addons/actions/src/loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const attachActionsToFunctionMocks: LoaderFunction = (context) => {
)
.forEach(([key, value]) => {
const previous = value.getMockImplementation();
if (previous?._actionAttached !== true) {
if (previous?._actionAttached !== true && previous?.isAction !== true) {
const implementation = (...params: unknown[]) => {
action(key)(...params);
return previous?.(...params);
Expand Down

0 comments on commit b005c19

Please sign in to comment.