Skip to content

Commit

Permalink
remove: Old code
Browse files Browse the repository at this point in the history
  • Loading branch information
im3dabasia committed Feb 20, 2025
1 parent d3c4e90 commit 8466587
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions packages/components/src/color-picker/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,45 +343,6 @@ describe( 'ColorPicker', () => {
} );
} );

// describe.each( [
// [ 'hsl', 'HSL' ],
// [ 'rgb', 'RGB' ],
// [ 'hex', 'HEX' ],
// ] )( 'copy button test for %s format', ( format, formatLabel ) => {
// it( `should copy the color value to the clipboard for ${ formatLabel }`, async () => {
// const color = '#000';
// const user = userEvent.setup();

// // Mocks navigator.clipboard.readText to return the provided color value, simulating clipboard behavior in tests.
// // This ensures that when the clipboard is read, the color value is returned.
// // Reference: https://jestjs.io/docs/jest-object#jestspyonobject-methodname
// const readTextMock = jest
// .spyOn( navigator.clipboard, 'readText' )
// .mockResolvedValue( color );

// render( <ColorPicker color={ color } enableAlpha={ false } /> );

// const formatSelector = screen.getByRole( 'combobox' );
// expect( formatSelector ).toBeVisible();
// await user.selectOptions( formatSelector, format );

// const copyButton = screen.getByRole( 'button', {
// name: 'Copy',
// } );
// expect( copyButton ).toBeVisible();

// await user.click( copyButton );

// await waitFor( async () => {
// const copiedText = await navigator.clipboard.readText();
// expect( copiedText ).toBe( color );
// } );

// // Restores the original readText implementation.
// readTextMock.mockRestore();
// } );
// } );

describe( 'ColorPicker copy button', () => {
let capturedValue: string | undefined;
let originalCreateElement: typeof document.createElement;
Expand Down

0 comments on commit 8466587

Please sign in to comment.