refactor(test): Replace inline snapshot with file snapshot ()

This commit is contained in:
yamashu 2024-10-09 06:13:27 +09:00 committed by GitHub
parent 66822c3bbc
commit 8b6bedab39
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 225 additions and 208 deletions
frontend/src/components/editor-page/sidebar/specific-sidebar-entries/revisions-sidebar-entry/revisions-modal

View file

@ -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",
}
`;

View file

@ -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()
})
})