-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UT structure aligned to Component=>Happy/Sad Path=>Tests. Coverage im…
…proved. Unused dependecies removed
- Loading branch information
1 parent
60cdd45
commit b6762c7
Showing
15 changed files
with
134 additions
and
115 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import FormButton from './form-button' | ||
|
||
test('Renders a FormButton using required props only', () => { | ||
const props = { | ||
type: 'button', | ||
label: 'Test' | ||
} | ||
render(<FormButton config={props} />) | ||
const element = screen.getByText(props.label) | ||
expect(element).toBeInTheDocument() | ||
describe('[FormButton]', () => { | ||
describe('[HAPPY PATH]', () => { | ||
test('Renders using required props only', () => { | ||
const props = { | ||
type: 'button', | ||
label: 'Test' | ||
} | ||
render(<FormButton config={props} />) | ||
const element = screen.getByText(props.label) | ||
expect(element).toBeInTheDocument() | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import FormInput from './form-input' | ||
|
||
test('Renders a FormInput with required props only', () => { | ||
const props = { | ||
label: 'Test', | ||
type: 'text', | ||
control: 'test', | ||
onInputChange: () => {} | ||
} | ||
render(<FormInput config={props} />) | ||
const element = screen.getByText(props.label) | ||
expect(element).toBeInTheDocument() | ||
describe('[FormInput]', () => { | ||
describe('[HAPPY PATH]', () => { | ||
test('Renders with required props only', () => { | ||
const props = { | ||
label: 'Test', | ||
type: 'text', | ||
control: 'test', | ||
onInputChange: () => {} | ||
} | ||
render(<FormInput config={props} />) | ||
const element = screen.getByText(props.label) | ||
expect(element).toBeInTheDocument() | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import GridLayout from './grid-layout' | ||
|
||
test('render a grid with required properties', () => { | ||
render(<GridLayout header={{ title: 'Test' }} />) | ||
const element = screen.getByText('Test') | ||
expect(element).toBeInTheDocument() | ||
describe('[GridLayout]', () => { | ||
describe('[HAPPY PATH]', () => { | ||
test('Renders with required properties only', () => { | ||
render(<GridLayout header={{ title: 'Test' }} />) | ||
const element = screen.getByText('Test') | ||
expect(element).toBeInTheDocument() | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import Title from './title' | ||
|
||
describe('[Title]', () => { | ||
describe('[HAPPY PATH]', () => { | ||
test('Renders with required props only', () => { | ||
const props = { | ||
title: 'My', | ||
subTitle: 'Test' | ||
} | ||
|
||
render(<Title {...props} />) | ||
const element = screen.getByText(props.title) | ||
expect(element).toBeInTheDocument() | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
src/components/users/update-password-form/update-password-form.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
describe('[UpdatePasswordForm]', () => { | ||
test('Dummy test only', () => { | ||
const test = 3 | ||
expect(test).toBe(3) | ||
describe('[HAPPY PATH]', () => { | ||
test('Dummy test only', () => { | ||
const test = 3 | ||
expect(test).toBe(3) | ||
}) | ||
}) | ||
}) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters