From 3feee840aa424819eb27241b8aeea07c1dab2388 Mon Sep 17 00:00:00 2001 From: Pivi Lartisant <90157528+pivilartisant@users.noreply.github.com> Date: Mon, 23 Oct 2023 11:14:54 +0200 Subject: [PATCH] Add Input Test (#366) --- ...x-regular-input-with-content-and-error.png | Bin 0 -> 9675 bytes ...gular-input-with-placeholder-and-error.png | Bin 0 -> 8824 bytes ...lar-input-with-placeholder-and-warning.png | Bin 0 -> 9252 bytes ....cy.tsx-regular-input-with-placeholder.png | Bin 0 -> 8174 bytes cypress/component/integration/Input.cy.tsx | 133 ++++++++++++++++++ 5 files changed, 133 insertions(+) create mode 100755 cypress-visual-screenshots/baseline/Input.cy.tsx-regular-input-with-content-and-error.png create mode 100755 cypress-visual-screenshots/baseline/Input.cy.tsx-regular-input-with-placeholder-and-error.png create mode 100755 cypress-visual-screenshots/baseline/Input.cy.tsx-regular-input-with-placeholder-and-warning.png create mode 100755 cypress-visual-screenshots/baseline/Input.cy.tsx-regular-input-with-placeholder.png create mode 100644 cypress/component/integration/Input.cy.tsx diff --git a/cypress-visual-screenshots/baseline/Input.cy.tsx-regular-input-with-content-and-error.png b/cypress-visual-screenshots/baseline/Input.cy.tsx-regular-input-with-content-and-error.png new file mode 100755 index 0000000000000000000000000000000000000000..9c15f938b288510cda761fa29a7d3b3a26459fc7 GIT binary patch literal 9675 zcmeHMdsLF?x~J`__L+8a+O5${M{7!*(!7x(iBhK-&G9zPWDZ$c31WFG$qQbf#>r}j zTHpaRA5z5*kEaYL_RPhi(07e7Oe6;V&iMz( zwe~NNVe^jw4M3o`&y5T#OIyd=F`3bI%n$fg%Q7zv+5pM?bQgbbluPiis82in)E@5u zwLME}$hX_3zg2OWextW$(GNmnWXB&FvYn=+?DX9`j}+> z@say{`ZXlpfpEbyHGWB*s(8#5Q)n0r|L1=6*Avh@y!Mf=o1#LB6)fn_zYY6M8DEDQ zM3j_HAXZL#o-(rM%pufiOLV;FxYDGr3v3sWO8i{A0u>SIg z6u?*(u=I3&zWt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I9pqpJ8pdQ07=*C;G~tv2LG^~<$yCV z(3w=pRq1HNj>DwQR{IL^seZl(h}zy`yu9-H!EL>gAf)H#k$1Q&3L23Q(b{dnys{2q zct|b1<8JP7>nFBG?9ou`R(sag=x=e@u2WzBpT@8=1o`=Uo7`bzhm9RE=qtvpokF3f zVMh!*V%W)rowm4B3U(^tP9^-et%PM;6Sg)3V1V`;;nn6>cA@mKGBPr=GF&`Aeee2t z`!7(Q{!8M{!yOWC?I;1<=)N`eiPQcfOr3+gT7q_oD4b9 J@TZG^{$IApyj1`I literal 0 HcmV?d00001 diff --git a/cypress-visual-screenshots/baseline/Input.cy.tsx-regular-input-with-placeholder.png b/cypress-visual-screenshots/baseline/Input.cy.tsx-regular-input-with-placeholder.png new file mode 100755 index 0000000000000000000000000000000000000000..e71c23ffef62f85e9c5efa7982b6639b5e1e6f0c GIT binary patch literal 8174 zcmeHLZBSZg7N+gAX&a-{P1mR)(xy(*WNf0w1dT*$({5@TwM}EK(O}&w)M&L}mEafI zIO3)ze#8$%qom^&Q$d{d)+j+RDdPv<%^IaQLa-vxLUKQ92ZfEw_{@B?c`-2%~ znD^Xs?m6dq&w0-K-YXv^p4#zp(8~w}Vn_V@@18**p1+AeJm>e~3$Wyk<0LTxff|T^ zH}34kXH54rZ0;4xu32s2h-Dp@YZtGQAVwvrpMky|cYaFhfC?+kKHW=0!W_{Pq@ zg&>wiyr+iPm{GD>VBM|MN~u9y5)b`690>w}D;`E#p~q2F>(fH$Nf%T0C`@|Zre0dTPZQKYeQ~!8z7QZIJeDUhrtl7NwU#yCG?BfPtR?s4*=;_tpF zmSO#Z%l9#xDn+Ff-F<>>gRyAR%LldMJmF5ayGt(Z?|!P1uI03OP+7_eSB`%J+m>z{ z=V3~(i*%DRgYEQ8c+EnMI`okB<5j<;{y}mpShj!gSbH+JPXVNA=D9f^_|_%%lfQ0i zlQ$A2ctEBfwOyS_5Ek4*?$IjEkK$;VEktz|vAk11cknP9OsutZ;0Z$d;*fl9eXn#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EZBdvYT zzhmi4p$k&C!3UsC<4CJg=qMI$R$-f#7qq7zm9~@_`Qph1kH@=~<)tu+y?4H_JFsH) zL#Vl$x({1!@iSIY%xfRoW0_d0^$RE_!_fs@GmbPCsIm`{ySFT*we*vZI%;j*Nm_9R z^=Ts<72iM+o5Q5qvW4y9w2T)$dS&TbN3}0M+5-3m?-Itvi-x;6E_sW=4THBByv5+{ z1@Bz&Qh}EVy-et3LN60~nb6CG|94Edma%v*-2KJn+1CiJpIJ-rwcIzz9VH^_OV8iz z&8;hL<<>3V`w&LO3xXE}Z#y6^c{u_8+~Wn|e+fdsPA+h{pVs-4d-%k^m-sICozE}- E6F?@NHUIzs literal 0 HcmV?d00001 diff --git a/cypress/component/integration/Input.cy.tsx b/cypress/component/integration/Input.cy.tsx new file mode 100644 index 00000000..92dc2b64 --- /dev/null +++ b/cypress/component/integration/Input.cy.tsx @@ -0,0 +1,133 @@ +import '../../../src/global.css'; +import React from 'react'; +import { Input } from '../../../src/components'; +import { compareSnapshot } from '../../compareSnapshot'; + +describe('Component | Integration | Input', function () { + describe('Input', () => { + describe('regular input with placeholder', () => { + beforeEach(() => { + cy.mount( +
+ +
, + ); + }); + + it('should render and have placeholder', () => { + cy.get('[data-testid="input-field"]') + .should('exist') + .and('have.attr', 'placeholder'); + }); + + it('should focus on click', () => { + cy.get('[data-testid="input-field"]').click().should('be.focused'); + }); + + it('should receive typed input', () => { + cy.get('[data-testid="input-field"]') + .type('typed content') + .should('have.value', 'typed content') + .clear() + .should('have.attr', 'placeholder'); + }); + + it('should match snapshot', () => { + compareSnapshot(cy, 'regular-input-with-placeholder'); + }); + }); + + describe('regular input with placeholder and error', () => { + beforeEach(() => { + cy.mount( +
+ +
, + ); + }); + + it('should render and have placeholder', () => { + cy.get('[data-testid="input-field"]') + .should('exist') + .and('have.attr', 'placeholder'); + }); + + it('should display error message', () => { + cy.get('[data-testid="input-field-message"]').contains('error'); + }); + + it('should match snapshot', () => { + compareSnapshot(cy, 'regular-input-with-placeholder-and-error'); + }); + }); + + describe('regular input with content and error', () => { + beforeEach(() => { + cy.mount( +
+ +
, + ); + }); + + it('should render and have placeholder', () => { + cy.get('[data-testid="input-field"]') + .should('exist') + .and('have.attr', 'placeholder'); + }); + + it('should wrong content displayed', () => { + cy.get('[data-testid="input-field"]') + .should('exist') + .and('have.value', 'wrong content'); + }); + + it('should display error message', () => { + cy.get('[data-testid="input-field-message"]').contains('error'); + }); + + it('should match snapshot', () => { + compareSnapshot(cy, 'regular-input-with-content-and-error'); + }); + }); + + describe('regular input with placeholder and warning', () => { + beforeEach(() => { + cy.mount( +
+ +
, + ); + }); + + it('should render placeholder and warning', () => { + cy.get('[data-testid="input-field"]') + .should('exist') + .and('have.attr', 'placeholder'); + cy.get('[data-testid="input-field-message"]').contains('warning'); + }); + + it('should receive typed input and render warning', () => { + cy.get('[data-testid="input-field"]') + .type('typed content') + .should('have.value', 'typed content'); + cy.get('[data-testid="input-field-message"]').contains('warning'); + }); + + it('should render warning with no content', () => { + cy.get('[data-testid="input-field"]') + .clear() + .should('have.attr', 'placeholder'); + + cy.get('[data-testid="input-field-message"]').should('exist'); + }); + it('should match snapshot', () => { + compareSnapshot(cy, 'regular-input-with-placeholder-and-warning'); + }); + }); + }); +});