@@ -132,4 +132,31 @@ describe('Inline chip - remove', () => {
132132 await expect . element ( page . getByText ( '#123' ) ) . not . toBeInTheDocument ( ) ;
133133 await expect . element ( page . getByText ( 'In Progress' ) ) . not . toBeInTheDocument ( ) ;
134134 } ) ;
135+ } ) ;
136+
137+ describe ( 'Inline chip - paste deduplication' , ( ) => {
138+ it ( 'resizing a pasted chip does not affect the original' , async ( ) => {
139+ renderEditor ( ) ;
140+ await insertInlineChipViaSlashMenu ( ) ;
141+
142+ await userEvent . keyboard ( '{Control>}a{/Control}' ) ;
143+ await userEvent . keyboard ( '{Control>}c{/Control}' ) ;
144+
145+ await userEvent . keyboard ( '{Control>}{End}{/Control}' ) ;
146+ await userEvent . keyboard ( '{Control>}v{/Control}' ) ;
147+
148+ const chips = page . getByText ( '#123' ) ;
149+ expect ( ( await chips . all ( ) ) . length ) . toBe ( 2 ) ;
150+
151+ await userEvent . click ( page . getByText ( '#123' ) . nth ( 1 ) ) ;
152+ await expect . element ( page . getByTestId ( 'popover-content' ) ) . toBeVisible ( ) ;
153+ await userEvent . click ( page . getByTitle ( 'Change size' ) ) ;
154+ await expect . element ( page . getByTestId ( 'size-menu' ) ) . toBeVisible ( ) ;
155+ await userEvent . click ( page . getByRole ( 'button' , { name : 'Tiny (inline)' , exact : true } ) ) ;
156+
157+ // Second chip is now XXS - status hidden for that chip
158+ // First chip should still be S - "In Progress" still visible once
159+ const statusBadges = page . getByText ( 'In Progress' ) ;
160+ expect ( ( await statusBadges . all ( ) ) . length ) . toBe ( 1 ) ;
161+ } ) ;
135162} ) ;
0 commit comments