-
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.
EES- 4677 Create Build Pipeline (#28)
EES- 4677 Create PR and CI Build Pipelines
- Loading branch information
1 parent
5aa0620
commit add8fa0
Showing
46 changed files
with
5,381 additions
and
1,181 deletions.
There are no files selected for viewing
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,5 +1,6 @@ | ||
{ | ||
"trailingComma": "all", | ||
"endOfLine": "lf", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": true | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,67 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": "." | ||
"name": "Root", | ||
"path": "./" | ||
}, | ||
{ | ||
"name": "Chatbot UI", | ||
"path": "./chatbot-ui" | ||
}, | ||
{ | ||
"name": "Response Automater", | ||
"path": "./response_automater" | ||
}, | ||
{ | ||
"name": "Response Automater Tests", | ||
"path": "./response_automater_tests" | ||
}, | ||
{ | ||
"name": "Data Ingestion API", | ||
"path": "./data_ingestion" | ||
}, | ||
{ | ||
"name": "Data Ingestion API Tests", | ||
"path": "./data_ingestion_tests" | ||
} | ||
], | ||
"settings": { | ||
"window.title": "Chatbot Prototype", | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true, | ||
"editor.formatOnSaveMode": "modificationsIfAvailable", | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
|
||
"search.exclude": { | ||
// Avoid polluting search results with lockfile content | ||
"Pipfile.lock": true, | ||
"pnpm-lock.yaml": true | ||
}, | ||
// Ensure VSCode uses pnpm instead of npm | ||
"npm.packageManager": "pnpm" | ||
"npm.packageManager": "pnpm", | ||
"jest.autoRun": "off", | ||
"jest.disabledWorkspaceFolders": [ | ||
"Root", | ||
"Response Automater", | ||
"Response Automater Tests", | ||
"Data Ingestion API", | ||
"Data Ingestion API Tests" | ||
] | ||
}, | ||
"extensions": { | ||
"recommendations": [ | ||
"ms-python.python", | ||
"orta.vscode-jest", | ||
"esbenp.prettier-vscode", | ||
"ms-python.black-formatter", | ||
"ms-azuretools.vscode-docker", | ||
"ms-azure-devops.azure-pipelines" | ||
] | ||
} | ||
} |
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,3 +1,20 @@ | ||
{ | ||
"extends": ["next/core-web-vitals", "plugin:prettier/recommended"] | ||
"extends": [ | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react/recommended", | ||
"plugin:react-hooks/recommended", | ||
"plugin:jsx-a11y/recommended", | ||
"plugin:import/typescript", | ||
"plugin:prettier/recommended" | ||
], | ||
"rules": { | ||
"react/react-in-jsx-scope": "off", | ||
"jsx-a11y/anchor-is-valid": "off", | ||
"no-console": "warn" | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "detect" | ||
} | ||
} | ||
} |
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,15 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Run Chatbot UI Tests", | ||
"type": "shell", | ||
"command": "pnpm run test", | ||
"group": "test", | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
} | ||
} | ||
] | ||
} |
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,8 @@ | ||
import { render } from '@testing-library/react'; | ||
import LoadingDots from '@/components/LoadingDots'; | ||
|
||
describe('Loading Dots', () => { | ||
it('Renders', () => { | ||
render(<LoadingDots color="red" />); | ||
}); | ||
}); |
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,30 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import Page from '@/components/Page'; | ||
|
||
describe('Page', () => { | ||
it('Renders', () => { | ||
render(<Page title={'Test Page Title'} />); | ||
|
||
expect(screen.getByRole('main')).toBeInTheDocument(); | ||
}); | ||
|
||
it('Renders a title and caption if provided', () => { | ||
render(<Page title="Test Page Title" caption="Test Page Caption" />); | ||
|
||
expect( | ||
screen.getByRole('heading', { name: 'Test Page Title' }), | ||
).toBeInTheDocument(); | ||
|
||
expect(screen.getByText('Test Page Caption')).toBeInTheDocument(); | ||
}); | ||
|
||
it('Renders children if provided', () => { | ||
render( | ||
<Page title={'Test Page Title'}> | ||
<span>This is some child content</span> | ||
</Page>, | ||
); | ||
|
||
expect(screen.getByText(/This is some child content/)).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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import PageBanner from '@/components/PageBanner'; | ||
|
||
describe('Page Banner', () => { | ||
it('Renders', () => { | ||
render(<PageBanner />); | ||
|
||
expect(screen.getByText(/This is a new service/)).toBeInTheDocument(); | ||
}); | ||
|
||
it('Displays a link for providing feedback', () => { | ||
render(<PageBanner />); | ||
|
||
expect(screen.getByRole('link', { name: 'feedback' })).toHaveAttribute( | ||
'href', | ||
'#', | ||
); | ||
}); | ||
}); |
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,5 +1,3 @@ | ||
import React from 'react'; | ||
|
||
const PageBanner = () => { | ||
return ( | ||
<div className="govuk-phase-banner"> | ||
|
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,45 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import PageFooter from '@/components/PageFooter'; | ||
|
||
describe('Page Footer', () => { | ||
it('Renders', () => { | ||
render(<PageFooter />); | ||
|
||
expect(screen.getByRole('contentinfo')).toBeInTheDocument(); | ||
}); | ||
|
||
it('Displays the expected links', () => { | ||
render(<PageFooter />); | ||
|
||
const expectedLinks: ExpectedLink[] = [ | ||
{ name: 'Cookies', target: '#' }, | ||
{ name: 'Privacy notice', target: '#' }, | ||
{ name: 'Contact us', target: '#' }, | ||
{ name: 'Accessibility statement', target: '#' }, | ||
{ name: 'Glossary', target: '#' }, | ||
{ name: 'Help and support', target: '#' }, | ||
{ | ||
name: 'Open Government Licence v3.0', | ||
target: | ||
'https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/', | ||
}, | ||
{ | ||
name: '© Crown copyright', | ||
target: | ||
'https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/', | ||
}, | ||
]; | ||
|
||
expectedLinks.forEach((link) => { | ||
expect(screen.getByRole('link', { name: link.name })).toHaveAttribute( | ||
'href', | ||
link.target, | ||
); | ||
}); | ||
}); | ||
}); | ||
|
||
interface ExpectedLink { | ||
name: string; | ||
target: string; | ||
} |
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,5 +1,3 @@ | ||
import React from 'react'; | ||
|
||
interface Props {} | ||
|
||
const PageFooter = ({}: Props) => ( | ||
|
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,22 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import PageHeader from '@/components/PageHeader'; | ||
|
||
describe('Page Banner', () => { | ||
it('Renders', () => { | ||
render(<PageHeader />); | ||
|
||
expect(screen.getByRole('banner')).toBeInTheDocument(); | ||
}); | ||
|
||
it('Displays the expected links', () => { | ||
render(<PageHeader />); | ||
|
||
expect( | ||
screen.getByRole('link', { name: 'Skip to main content' }), | ||
).toHaveAttribute('href', '#main-content'); | ||
|
||
expect( | ||
screen.getByRole('link', { name: 'Explore education statistics' }), | ||
).toHaveAttribute('href', '#'); | ||
}); | ||
}); |
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,5 +1,3 @@ | ||
import React from 'react'; | ||
|
||
interface Props {} | ||
|
||
const PageHeader = ({}: Props) => ( | ||
|
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,29 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import PageTitle from '@/components/PageTitle'; | ||
|
||
describe('Page Title', () => { | ||
it('Renders', () => { | ||
render(<PageTitle title="Test Page Title"></PageTitle>); | ||
|
||
expect( | ||
screen.getByRole('heading', { name: 'Test Page Title' }), | ||
).toBeInTheDocument(); | ||
}); | ||
|
||
it('Renders a caption if one is provided', () => { | ||
render( | ||
<PageTitle | ||
title="Test Page Title" | ||
caption="Test Caption Text" | ||
></PageTitle>, | ||
); | ||
|
||
expect(screen.getByText('Test Caption Text')).toBeInTheDocument(); | ||
}); | ||
|
||
it('Does not render a caption if none is provided', () => { | ||
render(<PageTitle title="Test Page Title"></PageTitle>); | ||
|
||
expect(screen.queryByText('Test Caption Text')).toBeNull(); | ||
}); | ||
}); |
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,5 +1,3 @@ | ||
import React from 'react'; | ||
|
||
interface Props { | ||
caption?: string; | ||
title: string; | ||
|
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 nextJest from 'next/jest.js'; | ||
|
||
const createJestConfig = nextJest({ | ||
dir: './', | ||
}); | ||
|
||
/** @type {import('jest').Config} */ | ||
const config = { | ||
collectCoverageFrom: ['./**/*.{ts,tsx}', '!./**/*.d.ts'], | ||
setupFilesAfterEnv: ['<rootDir>/setupTests.js'], | ||
verbose: true, | ||
testEnvironment: 'jest-environment-jsdom', | ||
resetMocks: true, | ||
reporters: ['default', 'jest-junit'], | ||
}; | ||
|
||
export default createJestConfig(config); |
Oops, something went wrong.