diff --git a/packages/react/src/wrap.spec.tsx b/packages/react/src/wrap.spec.tsx index bbb3cc502..3270655e0 100644 --- a/packages/react/src/wrap.spec.tsx +++ b/packages/react/src/wrap.spec.tsx @@ -170,3 +170,16 @@ describe('wrap.Delay().on', () => { expect(wrap.Delay({}).on(() => <>).displayName).toBe('wrap.Delay.on(Component)') }) }) + +describe('Wrap class method chaining', () => { + it('should maintain the same instance across method chaining', () => { + const suspenseInstance = wrap.Suspense({}) + const methodChainingInstance = suspenseInstance + .ErrorBoundary({ fallback: FALLBACK }) + .ErrorBoundaryGroup({}) + .Delay({}) + .Suspense({}) + + expect(suspenseInstance).toBe(methodChainingInstance) + }) +})