chore: better Prettier config for easier reviews
This commit is contained in:
@ -1,35 +1,35 @@
|
||||
import { FormState } from '../../../../components/design/FormState'
|
||||
import { FormState } from "../../../../components/design/FormState"
|
||||
|
||||
describe('<FormState />', () => {
|
||||
it('should return nothing if the state is idle', () => {
|
||||
cy.mount(<FormState state='idle' />)
|
||||
.get('[data-cy-root]')
|
||||
.should('be.empty')
|
||||
describe("<FormState />", () => {
|
||||
it("should return nothing if the state is idle", () => {
|
||||
cy.mount(<FormState state="idle" />)
|
||||
.get("[data-cy-root]")
|
||||
.should("be.empty")
|
||||
})
|
||||
|
||||
it('should return nothing if the message is null', () => {
|
||||
cy.mount(<FormState state='error' />)
|
||||
.get('[data-cy-root]')
|
||||
.should('be.empty')
|
||||
it("should return nothing if the message is null", () => {
|
||||
cy.mount(<FormState state="error" />)
|
||||
.get("[data-cy-root]")
|
||||
.should("be.empty")
|
||||
})
|
||||
|
||||
it('should render the <Loader /> if state is loading', () => {
|
||||
cy.mount(<FormState state='loading' />)
|
||||
.get('[data-cy=loader]')
|
||||
.should('be.visible')
|
||||
it("should render the <Loader /> if state is loading", () => {
|
||||
cy.mount(<FormState state="loading" />)
|
||||
.get("[data-cy=loader]")
|
||||
.should("be.visible")
|
||||
})
|
||||
|
||||
it('should render the success message if state is success', () => {
|
||||
const message = 'Success Message'
|
||||
cy.mount(<FormState state='success' message={message} id='success' />)
|
||||
.get('#success')
|
||||
it("should render the success message if state is success", () => {
|
||||
const message = "Success Message"
|
||||
cy.mount(<FormState state="success" message={message} id="success" />)
|
||||
.get("#success")
|
||||
.contains(message)
|
||||
})
|
||||
|
||||
it('should render the error message if state is error', () => {
|
||||
const message = 'Error Message'
|
||||
cy.mount(<FormState state='error' message={message} id='error' />)
|
||||
.get('#error')
|
||||
it("should render the error message if state is error", () => {
|
||||
const message = "Error Message"
|
||||
cy.mount(<FormState state="error" message={message} id="error" />)
|
||||
.get("#error")
|
||||
.contains(message)
|
||||
})
|
||||
})
|
||||
|
@ -1,48 +1,48 @@
|
||||
import { Input, getInputType } from '../../../../components/design/Input'
|
||||
import { Input, getInputType } from "../../../../components/design/Input"
|
||||
|
||||
describe('<Input />', () => {
|
||||
it('should render the label', () => {
|
||||
const labelContent = 'label content'
|
||||
describe("<Input />", () => {
|
||||
it("should render the label", () => {
|
||||
const labelContent = "label content"
|
||||
cy.mount(<Input label={labelContent} />)
|
||||
.get('label')
|
||||
.should('have.text', labelContent)
|
||||
.get("label")
|
||||
.should("have.text", labelContent)
|
||||
})
|
||||
|
||||
it('should not render forgot password link', () => {
|
||||
cy.mount(<Input type='text' label='content' showForgotPassword />)
|
||||
.get('[data-cy=forgot-password-link]')
|
||||
.should('not.exist')
|
||||
it("should not render forgot password link", () => {
|
||||
cy.mount(<Input type="text" label="content" showForgotPassword />)
|
||||
.get("[data-cy=forgot-password-link]")
|
||||
.should("not.exist")
|
||||
})
|
||||
|
||||
it('should render forgot password link', () => {
|
||||
cy.mount(<Input type='password' label='content' showForgotPassword />)
|
||||
.get('[data-cy=forgot-password-link]')
|
||||
.should('exist')
|
||||
it("should render forgot password link", () => {
|
||||
cy.mount(<Input type="password" label="content" showForgotPassword />)
|
||||
.get("[data-cy=forgot-password-link]")
|
||||
.should("exist")
|
||||
})
|
||||
|
||||
it('should not render the eye icon if the input is not of type "password"', () => {
|
||||
cy.mount(<Input type='text' label='content' />)
|
||||
.get('[data-cy=password-eye]')
|
||||
.should('not.exist')
|
||||
cy.mount(<Input type="text" label="content" />)
|
||||
.get("[data-cy=password-eye]")
|
||||
.should("not.exist")
|
||||
})
|
||||
|
||||
it('should handlePassword with eye icon', async () => {
|
||||
cy.mount(<Input type='password' label='content' />)
|
||||
.get('input')
|
||||
.should('have.attr', 'type', 'password')
|
||||
.get('[data-cy=password-eye]')
|
||||
it("should handlePassword with eye icon", async () => {
|
||||
cy.mount(<Input type="password" label="content" />)
|
||||
.get("input")
|
||||
.should("have.attr", "type", "password")
|
||||
.get("[data-cy=password-eye]")
|
||||
.click()
|
||||
.get('input')
|
||||
.should('have.attr', 'type', 'text')
|
||||
.get("input")
|
||||
.should("have.attr", "type", "text")
|
||||
})
|
||||
|
||||
describe('getInputType', () => {
|
||||
it('should return `text`', () => {
|
||||
expect(getInputType('password')).equal('text')
|
||||
describe("getInputType", () => {
|
||||
it("should return `text`", () => {
|
||||
expect(getInputType("password")).equal("text")
|
||||
})
|
||||
|
||||
it('should return `password`', () => {
|
||||
expect(getInputType('text')).equal('password')
|
||||
it("should return `password`", () => {
|
||||
expect(getInputType("text")).equal("password")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user