File tree Expand file tree Collapse file tree 5 files changed +12
-56
lines changed
__tests__/components/molecules
infrastructure/terraform/components/app Expand file tree Collapse file tree 5 files changed +12
-56
lines changed Original file line number Diff line number Diff line change @@ -12,30 +12,11 @@ jest.mocked(useAuthenticator).mockReturnValue(
1212) ;
1313
1414describe ( 'Header component' , ( ) => {
15- const ENV = process . env ;
16-
17- beforeEach ( ( ) => {
18- jest . resetModules ( ) ;
19- process . env = { ...ENV } ;
20- } ) ;
21-
22- afterAll ( ( ) => {
23- process . env = ENV ;
24- } ) ;
25-
2615 it ( 'renders component correctly' , ( ) => {
2716 render ( < NHSNotifyHeader /> ) ;
2817
2918 expect ( screen . getByTestId ( 'page-header' ) ) . toBeInTheDocument ( ) ;
3019 expect ( screen . getByTestId ( 'page-header-logo' ) ) . toBeInTheDocument ( ) ;
3120 expect ( screen . getByTestId ( 'auth-link' ) ) . toBeInTheDocument ( ) ;
3221 } ) ;
33-
34- it ( 'should not render sign in link' , ( ) => {
35- process . env . NEXT_PUBLIC_DISABLE_CONTENT = 'true' ;
36-
37- render ( < NHSNotifyHeader /> ) ;
38-
39- expect ( screen . queryByTestId ( 'auth-link' ) ) . not . toBeInTheDocument ( ) ;
40- } ) ;
4122} ) ;
Original file line number Diff line number Diff line change 1- import { NHSNotifyMain } from '@atoms/NHSNotifyMain/NHSNotifyMain' ;
2-
31export function NHSNotifyContainer ( {
42 children,
53} : {
64 children : React . ReactNode ;
75} ) {
8- return (
9- < div className = 'nhsuk-width-container' >
10- { process . env . NEXT_PUBLIC_DISABLE_CONTENT === 'true' ? (
11- < NHSNotifyMain >
12- < h1 > Coming soon</ h1 >
13- </ NHSNotifyMain >
14- ) : (
15- children
16- ) }
17- </ div >
18- ) ;
6+ return < div className = 'nhsuk-width-container' > { children } </ div > ;
197}
Original file line number Diff line number Diff line change @@ -21,11 +21,7 @@ export function NHSNotifyHeader({ dataTestId }: HeaderType) {
2121 < div className = 'nhsuk-header__logo' >
2222 < Link
2323 className = 'nhsuk-header__link nhsuk-header__link--service'
24- href = {
25- process . env . NEXT_PUBLIC_DISABLE_CONTENT === 'true'
26- ? '/'
27- : '/create-and-submit-templates'
28- }
24+ href = '/create-and-submit-templates'
2925 aria-label = 'NHS homepage'
3026 >
3127 < svg
@@ -53,9 +49,7 @@ export function NHSNotifyHeader({ dataTestId }: HeaderType) {
5349 </ Link >
5450 </ div >
5551 < div className = 'nhsuk-header__content' id = 'content-header' >
56- { process . env . NEXT_PUBLIC_DISABLE_CONTENT === 'true' ? null : (
57- < AuthLink />
58- ) }
52+ < AuthLink />
5953 </ div >
6054 </ div >
6155 </ header >
Original file line number Diff line number Diff line change @@ -28,15 +28,14 @@ resource "aws_amplify_app" "main" {
2828 ]
2929
3030 environment_variables = {
31- NOTIFY_GROUP = var.group
32- NOTIFY_ENVIRONMENT = var.environment
33- NOTIFY_DOMAIN_NAME = local.root_domain_name
34- ACCOUNT_ID = var.aws_account_id
35- NEXT_PUBLIC_DISABLE_CONTENT = var.disable_content
36- AMPLIFY_MONOREPO_APP_ROOT = " frontend"
37- API_BASE_URL = module.backend_api.api_base_url
38- USER_POOL_ID = jsondecode (aws_ssm_parameter. cognito_config . value )[" USER_POOL_ID" ]
39- USER_POOL_CLIENT_ID = jsondecode (aws_ssm_parameter. cognito_config . value )[" USER_POOL_CLIENT_ID" ]
40- CSRF_SECRET = aws_ssm_parameter.csrf_secret.value
31+ NOTIFY_GROUP = var.group
32+ NOTIFY_ENVIRONMENT = var.environment
33+ NOTIFY_DOMAIN_NAME = local.root_domain_name
34+ ACCOUNT_ID = var.aws_account_id
35+ AMPLIFY_MONOREPO_APP_ROOT = " frontend"
36+ API_BASE_URL = module.backend_api.api_base_url
37+ USER_POOL_ID = jsondecode (aws_ssm_parameter. cognito_config . value )[" USER_POOL_ID" ]
38+ USER_POOL_CLIENT_ID = jsondecode (aws_ssm_parameter. cognito_config . value )[" USER_POOL_CLIENT_ID" ]
39+ CSRF_SECRET = aws_ssm_parameter.csrf_secret.value
4140 }
4241}
Original file line number Diff line number Diff line change @@ -130,12 +130,6 @@ variable "commit_id" {
130130 default = " HEAD"
131131}
132132
133- variable "disable_content" {
134- type = string
135- description = " Value for turning switching disable conten true/false"
136- default = " false"
137- }
138-
139133variable "destination_vault_arn" {
140134 type = string
141135 description = " ARN of the backup vault in the destination account, if this environment should be backed up"
You can’t perform that action at this time.
0 commit comments