mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-03 08:28:54 -04:00
refactor(test): Replace inline snapshot with file snapshot (#5830)
This commit is contained in:
parent
66822c3bbc
commit
8b6bedab39
6 changed files with 225 additions and 208 deletions
frontend/src/components/editor-page/sidebar/specific-sidebar-entries/revisions-sidebar-entry/revisions-modal
|
@ -0,0 +1,41 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`invert unified patch inverts a patch correctly 1`] = `
|
||||
{
|
||||
"hunks": [
|
||||
{
|
||||
"linedelimiters": [
|
||||
"
|
||||
",
|
||||
"
|
||||
",
|
||||
"
|
||||
",
|
||||
"
|
||||
",
|
||||
"
|
||||
",
|
||||
"
|
||||
",
|
||||
],
|
||||
"lines": [
|
||||
"+a",
|
||||
"+b",
|
||||
" c",
|
||||
" d",
|
||||
"-d",
|
||||
" e",
|
||||
],
|
||||
"newLines": 5,
|
||||
"newStart": 1,
|
||||
"oldLines": 4,
|
||||
"oldStart": 1,
|
||||
},
|
||||
],
|
||||
"index": undefined,
|
||||
"newFileName": "a",
|
||||
"newHeader": "2022-07-03 21:21:07.499933337 +0200",
|
||||
"oldFileName": "b",
|
||||
"oldHeader": "2022-07-03 21:22:28.650972217 +0200",
|
||||
}
|
||||
`;
|
|
@ -18,44 +18,6 @@ describe('invert unified patch', () => {
|
|||
+d
|
||||
e`)[0]
|
||||
const result = invertUnifiedPatch(parsedPatch)
|
||||
expect(result).toMatchInlineSnapshot(`
|
||||
{
|
||||
"hunks": [
|
||||
{
|
||||
"linedelimiters": [
|
||||
"
|
||||
",
|
||||
"
|
||||
",
|
||||
"
|
||||
",
|
||||
"
|
||||
",
|
||||
"
|
||||
",
|
||||
"
|
||||
",
|
||||
],
|
||||
"lines": [
|
||||
"+a",
|
||||
"+b",
|
||||
" c",
|
||||
" d",
|
||||
"-d",
|
||||
" e",
|
||||
],
|
||||
"newLines": 5,
|
||||
"newStart": 1,
|
||||
"oldLines": 4,
|
||||
"oldStart": 1,
|
||||
},
|
||||
],
|
||||
"index": undefined,
|
||||
"newFileName": "a",
|
||||
"newHeader": "2022-07-03 21:21:07.499933337 +0200",
|
||||
"oldFileName": "b",
|
||||
"oldHeader": "2022-07-03 21:22:28.650972217 +0200",
|
||||
}
|
||||
`)
|
||||
expect(result).toMatchSnapshot()
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue