Skip to content

Commit

Permalink
Percy: Introduce hide-in-percy and hide diff problematic elements (ge…
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldutra authored and harveyrendell committed Nov 14, 2019
1 parent 571623a commit 11b8de3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
9 changes: 9 additions & 0 deletions client/app/assets/less/inc/misc.less
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,13 @@
height: 37px;
border-radius: 2px;
width: 37px;
}

/* --------------------------------------------------------
Percy
-----------------------------------------------------------*/
@media only percy {
.hide-in-percy, .pace {
visibility: hidden;
}
}
2 changes: 1 addition & 1 deletion client/app/components/users/UserEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export default class UserEdit extends React.Component {
<Form layout="vertical">
<hr />
<Form.Item label="API Key" className="m-b-10">
<InputWithCopy id="apiKey" value={user.apiKey} data-test="ApiKey" readOnly />
<InputWithCopy id="apiKey" className="hide-in-percy" value={user.apiKey} data-test="ApiKey" readOnly />
</Form.Item>
<Button
className="w-100"
Expand Down
5 changes: 1 addition & 4 deletions client/cypress/integration/user/edit_profile_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ describe('Edit Profile', () => {

it('renders the page and takes a screenshot', () => {
cy.getByTestId('Groups').should('contain', 'admin');
cy.getByTestId('ApiKey').then(($apiKey) => {
$apiKey.val('secret');
cy.percySnapshot('User Profile');
});
cy.percySnapshot('User Profile');
});

context('changing password', () => {
Expand Down

0 comments on commit 11b8de3

Please sign in to comment.