Skip to content

Commit d61385d

Browse files
committed
CCM-10917 Tidy up comments
1 parent 1623da9 commit d61385d

File tree

6 files changed

+1
-59
lines changed

6 files changed

+1
-59
lines changed

frontend/src/__tests__/utils/markdownit/__snapshots__/index.test.tsx.snap

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,4 @@ End of horizontal line</p>
7272
<p>This is a paragraph</p>
7373
<p>By doing a new line this starts a new paragraph</p>
7474
"
75-
`;
76-
77-
exports[`withEmbeddedLink should only process links and line breaks rules 1`] = `
78-
"
79-
# Heading<br>## sub heading<br>**bold**<br>* bullet point 1
80-
* bullet point 2<br>1. ordered list item 1
81-
2. ordered list item 2<br><a href="https://www.nhs.uk/example" target="_blank" rel="noopener noreferrer">Read more</a><br>https://www.nhs.uk/example<br>Before page break
82-
***
83-
After page break<br>Start of line break<br>end of line break<br>Before horizontal line
84-
---
85-
End of horizontal line<br>This is a paragraph<br>By doing a new line this starts a new paragraph
86-
"
87-
`;
75+
`;

frontend/src/__tests__/utils/markdownit/index.test.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
renderEmailMarkdown,
44
renderNHSAppMarkdown,
55
renderSMSMarkdown,
6-
withEmbeddedLink,
76
} from '@utils/markdownit';
87
import { mockDeep } from 'jest-mock-extended';
98
import { markdown } from '../../components/forms/fixtures';
@@ -80,24 +79,3 @@ describe('renderSMSMarkdown', () => {
8079
expect(renderSMSMarkdown(markdown)).toMatchSnapshot();
8180
});
8281
});
83-
84-
describe('withEmbeddedLink', () => {
85-
beforeEach(jest.resetAllMocks);
86-
87-
it('should enable links', () => {
88-
const markdownItWrapperMock = mockDeep<MarkdownItWrapper>();
89-
90-
markdownItWrapperMock.enableLineBreak.mockReturnValue(
91-
markdownItWrapperMock
92-
);
93-
94-
withEmbeddedLink('message with a [link](link.com)', markdownItWrapperMock);
95-
96-
expect(markdownItWrapperMock.enableLineBreak).toHaveBeenCalled();
97-
expect(markdownItWrapperMock.enable).toHaveBeenCalledWith('link');
98-
});
99-
100-
it('should only process links and line breaks rules', () => {
101-
expect(withEmbeddedLink(markdown)).toMatchSnapshot();
102-
});
103-
});

frontend/src/components/molecules/MarkdownContent/MarkdownContent.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// import ReactMarkdown from 'react-markdown';
21
import Markdown from 'markdown-to-jsx';
32
import React from 'react';
43

@@ -9,19 +8,6 @@ export function MarkdownContent({ segments }: MarkdownContentProps) {
98
<>
109
{segments.map((content, index) => {
1110
return (
12-
// <ReactMarkdown
13-
// key={index}
14-
// children={content}
15-
// allowedElements={['a', 'p']}
16-
// components={{
17-
// a(props) {
18-
// const { node, ...rest } = props;
19-
// return (
20-
// <a {...rest} target='_blank' rel='noopener noreferrer' />
21-
// );
22-
// },
23-
// }}
24-
// />
2511
<Markdown
2612
key={index}
2713
options={{

frontend/src/components/molecules/TemplateSubmitted/TemplateSubmitted.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import Link from 'next/link';
44
import { NHSNotifyMain } from '@atoms/NHSNotifyMain/NHSNotifyMain';
55
import content from '@content/content';
6-
// import { withEmbeddedLink } from '@utils/markdownit';
76
import React from 'react';
87
import { MarkdownContent } from '@molecules/MarkdownContent/MarkdownContent';
98

frontend/src/content/content.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,6 @@ const templateSubmitted = {
686686
],
687687
},
688688
],
689-
// doNext: "### If you've sent messages using NHS Notify\n\n[Raise a request with the Service Desk (opens in a new tab)](https://nhsdigitallive.service-now.com/csm?id=sc_cat_item&sys_id=ce81c3ae1b1c5190892d4046b04bcb83) once you've submitted all your templates.\n\nIf you replaced a template by submitting a new one, tell us which template you want to use in your Service Desk request.",
690689
backLinkText: backToAllTemplates,
691690
};
692691

frontend/src/utils/markdownit/index.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,3 @@ export function renderEmailMarkdown(
5050

5151
return markdown.render(value);
5252
}
53-
54-
export function withEmbeddedLink(
55-
content: string,
56-
markdown = new MarkdownItWrapper()
57-
) {
58-
markdown.enableLineBreak().enable('link');
59-
return markdown.renderInline(content);
60-
}

0 commit comments

Comments
 (0)