Skip to content

Commit 4be5889

Browse files
ihordubas99Copilot
andcommitted
test: add paste deduplication regression test
Co-authored-by: Copilot <copilot@github.com>
1 parent ba4a059 commit 4be5889

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

test/lib/components/integration/editor.inlineChip.browser.test.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)