diff --git a/src/components/RegisterCard/RegisterCard.cy.tsx b/src/components/RegisterCard/RegisterCard.cy.tsx new file mode 100644 index 0000000..8e470aa --- /dev/null +++ b/src/components/RegisterCard/RegisterCard.cy.tsx @@ -0,0 +1,78 @@ +import RegisterCard from './RegisterCard'; +import GlobalStyle from '@styles/global'; + +describe('', () => { + beforeEach(() => { + cy.mount( + <> + + + , + ); + }); + + it('should register card has margin-top: 2rem', () => { + cy.getByCy('register-card').should('have.css', 'margin-top', '32px'); + }); + + it('should register card has width: 16.875rem', () => { + cy.getByCy('register-card').should('have.css', 'width', '270px'); + }); + + it('should base card has padding-top: 2rem', () => { + cy.getByCy('base-card').should('have.css', 'padding-top', '32px'); + }); + + it('should base card has position: relative', () => { + cy.getByCy('base-card').should('have.css', 'position', 'relative'); + }); + + it('should link has color: purple-dark-secondary', () => { + cy.getByCy('link').should('have.css', 'color', 'rgb(105, 80, 161)'); + }); + + it('should circle has position: absolute', () => { + cy.getByCy('circle').should('have.css', 'position', 'absolute'); + }); + + it('should circle has top: -2rem', () => { + cy.getByCy('circle').should('have.css', 'top', '-32px'); + }); + + it('should circle has display: flex', () => { + cy.getByCy('circle').should('have.css', 'display', 'flex'); + }); + + it('should circle has justify-content: center', () => { + cy.getByCy('circle').should('have.css', 'justify-content', 'center'); + }); + + it('should circle has align-items: center', () => { + cy.getByCy('circle').should('have.css', 'align-items', 'center'); + }); + + it('should circle has background-color: purple-dark-secondary', () => { + cy.getByCy('circle').should( + 'have.css', + 'background-color', + 'rgb(105, 80, 161)', + ); + }); + + it('should circle has border-radius: 50%', () => { + cy.getByCy('circle').should('have.css', 'border-radius', '50%'); + }); + + it('should circle has width: 4rem', () => { + cy.getByCy('circle').should('have.css', 'width', '64px'); + }); + + it('should circle has height: 4rem', () => { + cy.getByCy('circle').should('have.css', 'height', '64px'); + }); + + it('should redirect to register page when click on link', () => { + cy.getByCy('link').click(); + cy.url().should('include', 'http://localhost:3000/__/'); + }); +}); diff --git a/src/components/RegisterCard/RegisterCard.test.tsx b/src/components/RegisterCard/RegisterCard.test.tsx new file mode 100644 index 0000000..7bb9988 --- /dev/null +++ b/src/components/RegisterCard/RegisterCard.test.tsx @@ -0,0 +1,33 @@ +import { render, screen } from '@testing-library/react'; + +import RegisterCard from './RegisterCard'; + +describe('', () => { + beforeEach(() => { + render(); + }); + + it('should be defined', () => { + screen.getByTestId('register-card'); + }); + + it('should render base card', () => { + screen.getByTestId('base-card'); + }); + + it('should render circle', () => { + screen.getByTestId('circle'); + }); + + it('should render text', () => { + screen.getByTestId('text'); + }); + + it('should render person icon', () => { + screen.getByTestId('person-icon'); + }); + + it('should render link', () => { + screen.getByText('cadastro gratuito'); + }); +}); diff --git a/src/components/RegisterCard/RegisterCard.tsx b/src/components/RegisterCard/RegisterCard.tsx new file mode 100644 index 0000000..08a9804 --- /dev/null +++ b/src/components/RegisterCard/RegisterCard.tsx @@ -0,0 +1,30 @@ +import BaseCard from '@components/BaseCard'; +import Text from '@components/Text'; +import { Person } from '@assets/db.icons'; + +import * as S from './styles'; + +const RegisterCard = () => { + const textLabel = ( + + Faça seu{' '} + + cadastro gratuito + {' '} + e encontre vagas de acordo com seu perfil. + + ); + + return ( + + + + + + + + + ); +}; + +export default RegisterCard; diff --git a/src/components/RegisterCard/index.ts b/src/components/RegisterCard/index.ts new file mode 100644 index 0000000..c7901f6 --- /dev/null +++ b/src/components/RegisterCard/index.ts @@ -0,0 +1 @@ +export { default } from './RegisterCard'; diff --git a/src/components/RegisterCard/styles.ts b/src/components/RegisterCard/styles.ts new file mode 100644 index 0000000..717b49c --- /dev/null +++ b/src/components/RegisterCard/styles.ts @@ -0,0 +1,29 @@ +import styled from 'styled-components'; + +export const RegisterCard = styled.div` + margin-top: 2rem; + width: 16.875rem; + + .base-card { + padding-top: 2rem; + position: relative; + + .text { + a { + color: var(--purple-dark-secondary); + } + } + } +`; + +export const Circle = styled.div` + position: absolute; + top: -2rem; + display: flex; + justify-content: center; + align-items: center; + background-color: var(--purple-dark-secondary); + border-radius: 50%; + width: 4rem; + height: 4rem; +`; diff --git a/src/styles/global.ts b/src/styles/global.ts index 9ae23ef..090f23a 100644 --- a/src/styles/global.ts +++ b/src/styles/global.ts @@ -5,6 +5,7 @@ export default createGlobalStyle` --purple: #5D5FEF; --purple-light: #B2A1D9; --purple-dark: #1A1033; + --purple-dark-secondary: #6950A1; --white: #FFFFFF; --gray: #A6A8AB; --dark-grey: #4A4A68;