mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Cases] Update notify user HTML email template to use current year dynamically (#161327)
## Summary
This PR adds current year dynamcially to notify user HTML email template
footer.

### Checklist
Delete any items that are not applicable to this PR.
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
This commit is contained in:
parent
1a5dc8253e
commit
4346b09760
3 changed files with 11 additions and 1 deletions
|
@ -79,6 +79,7 @@ export const assigneesTemplateRenderer = async (
|
|||
? `${caseData.attributes.description.slice(0, DESCRIPTION_LIMIT)}...`
|
||||
: caseData.attributes.description,
|
||||
url: caseUrl,
|
||||
currentYear: new Date().getUTCFullYear(),
|
||||
});
|
||||
|
||||
return template;
|
||||
|
|
|
@ -186,7 +186,7 @@
|
|||
<tr>
|
||||
<td
|
||||
style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; line-height: 24px;">
|
||||
© 2022 Elasticsearch B.V. All Rights Reserved.<br />
|
||||
© {{currentYear}} Elasticsearch B.V. All Rights Reserved.<br />
|
||||
Elasticsearch is a trademark of Elasticsearch BV, registered in the
|
||||
U.S. and in other countries / <a href="https://www.elastic.co/legal/trademarks"
|
||||
style="text-decoration: none; color: #0071C2; border-width: 0;">Trademarks</a>
|
||||
|
|
|
@ -73,4 +73,13 @@ describe('Assignees template', () => {
|
|||
|
||||
expect(container.querySelector('.btn')).not.toBeTruthy();
|
||||
});
|
||||
|
||||
it('renders current year correctly', async () => {
|
||||
const currentYear = new Date().getUTCFullYear();
|
||||
const footerText = `© ${currentYear} Elasticsearch B.V. All Rights Reserved.`;
|
||||
|
||||
const container = await getHTMLNode(caseSO, mockCaseUrl);
|
||||
|
||||
expect(getByText(container, footerText, { exact: false })).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue