mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Security Solution][Investigations] Fixes rendering issue of last element of a task list when empty (#122242) (#122266)
* fix: fixes the issue where the last element of a task list would not render properly * test: update test Co-authored-by: Jan Monschke <jan.monschke@elastic.co>
This commit is contained in:
parent
f882402f84
commit
338e15e5a7
2 changed files with 23 additions and 1 deletions
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { createNote } from './helpers';
|
||||
|
||||
describe('createNote', () => {
|
||||
it(`does not trim the note's text content`, () => {
|
||||
// A note with two empty todo items.
|
||||
// Notice the required trailing whitespace which is required otherwise
|
||||
// markdown renderers will not render the list correctly
|
||||
const note = '- [ ] \n\n- [ ] ';
|
||||
expect(createNote({ newNote: note })).toEqual(
|
||||
expect.objectContaining({
|
||||
note,
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
|
@ -79,7 +79,7 @@ export const createNote = ({ newNote }: { newNote: string }): Note => ({
|
|||
created: moment.utc().toDate(),
|
||||
id: uuid.v4(),
|
||||
lastEdit: null,
|
||||
note: newNote.trim(),
|
||||
note: newNote,
|
||||
saveObjectId: null,
|
||||
user: 'elastic', // TODO: get the logged-in Kibana user
|
||||
version: null,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue