Skip to content

Commit

Permalink
Update from projects (#83)
Browse files Browse the repository at this point in the history
* Update from projects

---------

Co-authored-by: daniele <[email protected]>
  • Loading branch information
daniele-20tab and daniele authored Apr 2, 2024
1 parent d5e83a2 commit c673a76
Show file tree
Hide file tree
Showing 67 changed files with 1,905 additions and 2,230 deletions.
57 changes: 52 additions & 5 deletions {{cookiecutter.project_dirname}}/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ignorePatterns": "*.js",
"ignorePatterns": ["*.js", "*.mjs"],
"parser": "@typescript-eslint/parser",
"settings": {
"react": {
Expand All @@ -26,16 +26,63 @@
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:security/recommended"
"plugin:security/recommended-legacy"
],
"rules": {
"@typescript-eslint/consistent-type-imports": "warn",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": ["warn", {"argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
"camelcase": [2, {"properties": "always"}],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"camelcase": [
2,
{
"properties": "always"
}
],
"prettier/prettier": "error",
"react/no-unescaped-entities": 0,
"react/prop-types": 0,
"security/detect-object-injection": 0
"security/detect-object-injection": 0,
"import/order": [
"warn",
{
"alphabetize": {
"caseInsensitive": true,
"order": "asc"
},
"groups": [
[
"builtin",
"external"
],
"internal",
[
"parent",
"sibling",
"index"
],
"object",
"type"
],
"newlines-between": "always",
"pathGroups": [
{
"pattern": "@/components/**",
"group": "internal",
"position": "before"
},
{
"pattern": "@/utils/**",
"group": "internal",
"position": "after"
}
]
}
]
}
}
5 changes: 4 additions & 1 deletion {{cookiecutter.project_dirname}}/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ yarn-error.log*
terraform.tfvars

# vercel
.vercel
.vercel/

# VisualStudioCode
.vscode/

# typescript
*.tsbuildinfo
next-env.d.ts

# Sentry Config File
.sentryclirc
1 change: 1 addition & 0 deletions {{cookiecutter.project_dirname}}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ To enable the Pact broker integration, the following variables should be set in

To enable the Sentry integration, the following variables should be set in the GitLab respository:
```git
NEXT_PUBLIC_SENTRY_TRACE_SAMPLE_RATE: 0.1
SENTRY_AUTH_TOKEN (protected and masked) from Sentry
SENTRY_DSN (protected and masked) from Sentry
SENTRY_ORG (protected) e.g.: 20tab
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { expect } from '@jest/globals'
import { screen } from '@testing-library/react'
import React from 'react'

import { Navbar } from '@/components/Navbar'
import { renderWithWrappers } from '@/__tests__/functions'

const setup = () => renderWithWrappers(<Navbar />)
import { renderWithWrappers } from '@/__tests__/functions'

test('Navbar renders correctly', () => {
setup()
expect(screen.getByRole('img')).toBeTruthy()
const container = renderWithWrappers(<Navbar />)
expect(container).toMatchSnapshot()
})

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Navbar renders correctly 1`] = `
.c0 {
width: 100%;
background-color: #F4F7F8;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 5px;
}
.c0 svg {
height: 48px;
}
.c0 svg path {
fill: #4d517a;
}
.c0 svg path:last-child {
fill: #FFFFFF;
}
<div>
<nav
class="c0"
>
<a
href="/"
>
<svg
viewBox="0 0 395 170"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M220.5 84.7c1.7-2.2 2.9-4.3 3.6-6.2.8-1.9 1.2-3.9 1.2-5.9 0-4.3-1.5-7.9-4.4-10.8-2.9-2.9-6.7-4.3-11.2-4.3-5.1 0-9.7 1.9-13.6 5.7l3.9 4c3.1-2.9 6.3-4.4 9.7-4.4 2.9 0 5.2.9 7 2.7 1.8 1.8 2.6 4.2 2.6 7 0 1.7-.3 3.1-.9 4.5-.6 1.3-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expand Up @@ -3,6 +3,7 @@ import { screen } from '@testing-library/react'
import React from 'react'

import { Button } from '@/components/commons/Button'

import { renderWithWrappers } from '@/__tests__/functions'

const solidSetup = () => renderWithWrappers(<Button />)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { expect } from '@jest/globals'
import { screen } from '@testing-library/react'
import React from 'react'

import { renderWithWrappers } from '@/__tests__/functions'
import { H1, H2, H3, H4, Text } from '@/components/commons/Typography'

import { renderWithWrappers } from '@/__tests__/functions'

describe('Titles', () => {
describe('H1', () => {
it('Normal H1 renders correctly', () => {
Expand All @@ -13,7 +14,7 @@ describe('Titles', () => {
})
it('Normal H1 renders correctly with style props', () => {
renderWithWrappers(
<H1.Normal uppercase italic color='red'>
<H1.Normal $uppercase $italic color='red'>
MainTitle
</H1.Normal>
)
Expand All @@ -32,7 +33,7 @@ describe('Titles', () => {
})
it('Big H1 renders correctly with style props', () => {
renderWithWrappers(
<H1.Big uppercase italic color='red'>
<H1.Big $uppercase $italic color='red'>
MainTitle
</H1.Big>
)
Expand All @@ -51,7 +52,7 @@ describe('Titles', () => {
})
it('Medium H1 renders correctly with style props', () => {
renderWithWrappers(
<H1.Medium uppercase italic color='red'>
<H1.Medium $uppercase $italic color='red'>
MainTitle
</H1.Medium>
)
Expand All @@ -72,7 +73,7 @@ describe('Titles', () => {
})
it('Normal H2 renders correctly with style props', () => {
renderWithWrappers(
<H2.Normal uppercase italic color='red'>
<H2.Normal $uppercase $italic color='red'>
MainTitle
</H2.Normal>
)
Expand All @@ -93,7 +94,7 @@ describe('Titles', () => {
})
it('H3 renders correctly with style props', () => {
renderWithWrappers(
<H3.Normal uppercase italic color='red'>
<H3.Normal $uppercase $italic color='red'>
MainTitle
</H3.Normal>
)
Expand All @@ -114,7 +115,7 @@ describe('Titles', () => {
})
it('H4 renders correctly with style props', () => {
renderWithWrappers(
<H4.Normal uppercase italic color='red'>
<H4.Normal $uppercase $italic color='red'>
MainTitle
</H4.Normal>
)
Expand All @@ -138,7 +139,7 @@ describe('Text', () => {
})
it('Normal Text renders correctly with style props', () => {
renderWithWrappers(
<Text.Normal uppercase italic color='red'>
<Text.Normal $uppercase $italic color='red'>
MainParagraph
</Text.Normal>
)
Expand All @@ -159,7 +160,7 @@ describe('Text', () => {
})
it('NormalBold Text renders correctly with style props', () => {
renderWithWrappers(
<Text.NormalBold uppercase italic color='red'>
<Text.NormalBold $uppercase $italic color='red'>
MainParagraph
</Text.NormalBold>
)
Expand All @@ -180,7 +181,7 @@ describe('Text', () => {
})
it('Small Text renders correctly with style props', () => {
renderWithWrappers(
<Text.Small uppercase italic color='red'>
<Text.Small $uppercase $italic color='red'>
MainParagraph
</Text.Small>
)
Expand All @@ -199,7 +200,7 @@ describe('Text', () => {
})
it('SmallBold Text renders correctly with style props', () => {
renderWithWrappers(
<Text.SmallBold uppercase italic color='red'>
<Text.SmallBold $uppercase $italic color='red'>
MainParagraph
</Text.SmallBold>
)
Expand All @@ -220,7 +221,7 @@ describe('Text', () => {
})
it('Medium Text renders correctly with style props', () => {
renderWithWrappers(
<Text.Medium uppercase italic color='red'>
<Text.Medium $uppercase $italic color='red'>
MainParagraph
</Text.Medium>
)
Expand All @@ -239,7 +240,7 @@ describe('Text', () => {
})
it('MediumBold Text renders correctly with style props', () => {
renderWithWrappers(
<Text.MediumBold uppercase italic color='red'>
<Text.MediumBold $uppercase $italic color='red'>
MainParagraph
</Text.MediumBold>
)
Expand All @@ -260,7 +261,7 @@ describe('Text', () => {
})
it('Big Text renders correctly with style props', () => {
renderWithWrappers(
<Text.Big uppercase italic color='red'>
<Text.Big $uppercase $italic color='red'>
MainParagraph
</Text.Big>
)
Expand All @@ -279,7 +280,7 @@ describe('Text', () => {
})
it('BigBold Text renders correctly with style props', () => {
renderWithWrappers(
<Text.BigBold uppercase italic color='red'>
<Text.BigBold $uppercase $italic color='red'>
MainParagraph
</Text.BigBold>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { expect } from '@jest/globals'
import React from 'react'

import Layout from '@/components/layout/Base'

import { renderWithWrappers } from '@/__tests__/functions'

test('Navbar renders correctly', () => {
const container = renderWithWrappers(
<Layout>
<p>Test base layout</p>
</Layout>
)
expect(container).toMatchSnapshot()
})
Loading

0 comments on commit c673a76

Please sign in to comment.