Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upfeat(ClipboardCopy): Convert clipboard copy to typescript #2131
Conversation
This comment has been minimized.
This comment has been minimized.
PatternFly-React preview: https://2131-pr-patternfly-react-patternfly.surge.sh |
This comment has been minimized.
This comment has been minimized.
codecov-io
commented
May 31, 2019
•
Codecov Report
@@ Coverage Diff @@
## master #2131 +/- ##
=========================================
Coverage ? 80.54%
=========================================
Files ? 666
Lines ? 8470
Branches ? 729
=========================================
Hits ? 6822
Misses ? 1281
Partials ? 367
Continue to review full report at Codecov.
|
Thank you! |
...s/patternfly-4/react-core/src/components/ClipboardCopy/ClipboardCopy.tsx
Outdated
Show resolved
Hide resolved
@@ -31,7 +31,7 @@ export interface TooltipProps extends Omit<HTMLProps<HTMLDivElement>, 'content' | |||
/** z-index of the tooltip */ | |||
zIndex?: number; | |||
/** Size of the tooltip */ | |||
maxWidth?: '12.5rem'; | |||
maxWidth?: string; |
This comment has been minimized.
This comment has been minimized.
...s/patternfly-4/react-core/src/components/ClipboardCopy/ClipboardCopy.tsx
Outdated
Show resolved
Hide resolved
...ernfly-4/react-core/src/components/ClipboardCopy/ClipboardCopyButton.tsx
Outdated
Show resolved
Hide resolved
...nfly-4/react-core/src/components/ClipboardCopy/ClipboardCopyExpanded.tsx
Outdated
Show resolved
Hide resolved
...ernfly-4/react-core/src/components/ClipboardCopy/ClipboardCopyToggle.tsx
Outdated
Show resolved
Hide resolved
/** Flag to show if the input is read only. */ | ||
isReadOnly?: boolean; | ||
/** Adds Clipboard Copy variant styles. */ | ||
variant?: typeof ClipboardCopyVariant | 'inline' | 'expansion'; |
This comment has been minimized.
This comment has been minimized.
tlabaj
Jun 17, 2019
Contributor
I thought we decided to just have the union of the values here and not the "Typeof"
This comment has been minimized.
This comment has been minimized.
jessiehuff
Jun 17, 2019
Author
Contributor
I believe that we need the typeof for the older consumers using the enum.
...s/patternfly-4/react-core/src/components/ClipboardCopy/ClipboardCopy.tsx
Outdated
Show resolved
Hide resolved
...ernfly-4/react-core/src/components/ClipboardCopy/ClipboardCopyButton.tsx
Outdated
Show resolved
Hide resolved
it('Verify content expands', () => { | ||
cy.get('.pf-c-clipboard-copy__group-toggle').click(); | ||
cy.get('.pf-c-clipboard-copy').should('have.class', 'pf-m-expanded'); | ||
}); |
This comment has been minimized.
This comment has been minimized.
tlabaj
Jun 17, 2019
Contributor
I think we should add more verification steps here. We dod not verify that the copy actually works and I think we need to.
This comment has been minimized.
This comment has been minimized.
jessiehuff
Jun 17, 2019
Author
Contributor
Do you know of a good way to test the copy paste feature? I tried this:
it('Verify copy to clipboard works', () => {
const form = cy.get('.pf-c-form-control');
form.clear().type('Hi');
cy.get('.pf-c-clipboard-copy__group-copy').click();
cy.get('.pf-c-form-control').clear().type('{cmd}v');
form.should('have.value', 'Hi');
});
But it always ends up typing "v" instead of doing a paste. I've been looking into it, but I'm not sure what the solution would be: cypress-io/cypress#3316
This comment has been minimized.
This comment has been minimized.
PatternFly-React preview: https://patternfly-react-pr-2131.surge.sh |
LGTM |
jessiehuff commentedMay 31, 2019
Fixes #2130