Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCM-6834: remove placeholder #167

Merged
merged 3 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion infrastructure/terraform/components/app/amplify_app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ resource "aws_amplify_app" "main" {
NOTIFY_GROUP = var.group
NOTIFY_ENVIRONMENT = var.environment
NOTIFY_DOMAIN_NAME = local.root_domain_name
NEXT_PUBLIC_DISABLE_CONTENT = var.disable_content
NEXT_PUBLIC_ENABLE_COGNITO_IDP = var.enable_cognito_built_in_idp
NEXT_PUBLIC_CIS2_PROVIDER_NAME = local.cis2_idp_name
CSRF_SECRET = aws_ssm_parameter.csrf_secret.value
Expand Down
6 changes: 0 additions & 6 deletions infrastructure/terraform/components/app/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,6 @@ variable "commit_id" {
default = "HEAD"
}

variable "disable_content" {
type = string
description = "Value for turning switching disable content true/false"
default = "false"
}

variable "enable_cis2_idp" {
type = bool
description = "Switch to enable the CIS2 Cognito federation"
Expand Down
21 changes: 1 addition & 20 deletions src/__tests__/components/Header.test.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
import { render, screen } from '@testing-library/react';
import { render } from '@testing-library/react';
import { NHSNotifyHeader } from '@/src/components/molecules/Header/Header';

jest.mock('@/src/components/molecules/AuthLink/AuthLink', () => ({
AuthLink: () => <div data-testid='auth-link' />,
}));

describe('Header component', () => {
const ENV = process.env;

beforeEach(() => {
jest.resetModules();
process.env = { ...ENV };
});

afterAll(() => {
process.env = ENV;
});

it('renders component correctly', async () => {
const container = render(<NHSNotifyHeader />);

expect(container.asFragment()).toMatchSnapshot();
});

it('should not render auth link', () => {
process.env.NEXT_PUBLIC_DISABLE_CONTENT = 'true';

render(<NHSNotifyHeader />);

expect(screen.queryByTestId('auth-link')).not.toBeInTheDocument();
});
});
8 changes: 2 additions & 6 deletions src/components/layouts/container/container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ export function NHSNotifyContainer({
}) {
return (
<div className='nhsuk-width-container'>
<main className='nhsuk-main-wrapper nhsuk-u-padding-top-4' role='main'>
{process.env.NEXT_PUBLIC_DISABLE_CONTENT === 'true' ? (
<h1>Coming soon</h1>
) : (
children
)}
<main className='nhsuk-main-wrapper' role='main'>
{children}
</main>
</div>
);
Expand Down
5 changes: 1 addition & 4 deletions src/components/molecules/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ export function NHSNotifyHeader({ dataTestId }: HeaderType) {
</Link>
</div>
<div className='nhsuk-header__content' id='content-header'>
{/* I am currently testing the link wrapper, this will change later when we implement auth as the link will change based on auth state */}
{process.env.NEXT_PUBLIC_DISABLE_CONTENT === 'true' ? undefined : (
<AuthLink />
)}
<AuthLink />
</div>
</div>
</header>
Expand Down
Loading