2019-10-12 21:45:49 +00:00
import { parse , html } from "../diff2html" ;
2019-10-21 22:37:42 +00:00
import { DiffFile , LineType , OutputFormatType } from "../types" ;
2015-12-23 13:12:32 +00:00
2019-10-06 20:04:33 +00:00
const diffExample1 =
"diff --git a/sample b/sample\n" +
"index 0000001..0ddf2ba\n" +
"--- a/sample\n" +
"+++ b/sample\n" +
"@@ -1 +1 @@\n" +
"-test\n" +
"+test1\n" ;
2015-12-23 13:12:32 +00:00
2019-10-12 21:45:49 +00:00
const jsonExample1 : DiffFile [ ] = [
2019-10-06 20:04:33 +00:00
{
blocks : [
{
lines : [
{
content : "-test" ,
2019-10-12 21:45:49 +00:00
type : LineType . DELETE ,
2019-10-06 20:04:33 +00:00
oldNumber : 1 ,
2019-10-12 21:45:49 +00:00
newNumber : undefined
2019-10-06 20:04:33 +00:00
} ,
{
content : "+test1" ,
2019-10-12 21:45:49 +00:00
type : LineType . INSERT ,
oldNumber : undefined ,
2019-10-06 20:04:33 +00:00
newNumber : 1
}
] ,
2019-10-12 21:45:49 +00:00
oldStartLine : 1 ,
oldStartLine2 : undefined ,
newStartLine : 1 ,
2019-10-06 20:04:33 +00:00
header : "@@ -1 +1 @@"
}
] ,
deletedLines : 1 ,
addedLines : 1 ,
checksumBefore : "0000001" ,
checksumAfter : "0ddf2ba" ,
oldName : "sample" ,
newName : "sample" ,
2019-10-12 21:45:49 +00:00
language : "" ,
isCombined : false ,
isGitDiff : true
2019-10-06 20:04:33 +00:00
}
] ;
2016-04-25 16:12:27 +00:00
2019-10-06 20:04:33 +00:00
const filesExample1 =
2016-04-25 16:12:27 +00:00
'<div class="d2h-file-list-wrapper">\n' +
2016-05-21 00:34:03 +00:00
' <div class="d2h-file-list-header">\n' +
' <span class="d2h-file-list-title">Files changed (1)</span>\n' +
' <a class="d2h-file-switch d2h-hide">hide</a>\n' +
' <a class="d2h-file-switch d2h-show">show</a>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
2016-05-21 00:34:03 +00:00
' <ol class="d2h-file-list">\n' +
' <li class="d2h-file-list-line">\n' +
' <span class="d2h-file-name-wrapper">\n' +
2018-11-18 15:38:46 +00:00
' <svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"\n' +
' viewBox="0 0 14 16" width="14">\n' +
' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM4 8c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3-3-1.34-3-3z"></path>\n' +
' </svg> <a href="#d2h-675094" class="d2h-file-name">sample</a>\n' +
2016-05-21 00:34:03 +00:00
' <span class="d2h-file-stats">\n' +
' <span class="d2h-lines-added">+1</span>\n' +
' <span class="d2h-lines-deleted">-1</span>\n' +
2019-10-06 20:04:33 +00:00
" </span>\n" +
" </span>\n" +
"</li>\n" +
" </ol>\n" +
"</div>" ;
2016-05-21 00:34:03 +00:00
2019-10-06 20:04:33 +00:00
const htmlLineExample1 =
2016-04-25 16:12:27 +00:00
'<div class="d2h-wrapper">\n' +
' <div id="d2h-675094" class="d2h-file-wrapper" data-lang="">\n' +
' <div class="d2h-file-header">\n' +
' <span class="d2h-file-name-wrapper">\n' +
2018-11-18 15:38:46 +00:00
' <svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">\n' +
' <path d="M6 5H2v-1h4v1zM2 8h7v-1H2v1z m0 2h7v-1H2v1z m0 2h7v-1H2v1z m10-7.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h7.5l3.5 3.5z m-1 0.5L8 2H1v12h10V5z"></path>\n' +
' </svg> <span class="d2h-file-name">sample</span>\n' +
2016-05-21 00:34:03 +00:00
' <span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span></span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
2016-04-25 16:12:27 +00:00
' <div class="d2h-file-diff">\n' +
' <div class="d2h-code-wrapper">\n' +
' <table class="d2h-diff-table">\n' +
' <tbody class="d2h-diff-tbody">\n' +
2019-10-06 20:04:33 +00:00
" <tr>\n" +
2016-04-25 16:12:27 +00:00
' <td class="d2h-code-linenumber d2h-info"></td>\n' +
' <td class="d2h-info">\n' +
2016-05-21 00:34:03 +00:00
' <div class="d2h-code-line d2h-info">@@ -1 +1 @@</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
"</tr><tr>\n" +
2019-11-26 16:07:53 +00:00
' <td class="d2h-code-linenumber d2h-del d2h-change">\n' +
2016-05-21 00:34:03 +00:00
' <div class="line-num1">1</div>\n' +
'<div class="line-num2"></div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2019-11-26 16:07:53 +00:00
' <td class="d2h-del d2h-change">\n' +
' <div class="d2h-code-line d2h-del d2h-change">\n' +
2016-04-25 16:12:27 +00:00
' <span class="d2h-code-line-prefix">-</span>\n' +
' <span class="d2h-code-line-ctn"><del>test</del></span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr><tr>\n" +
2019-11-26 16:07:53 +00:00
' <td class="d2h-code-linenumber d2h-ins d2h-change">\n' +
2016-05-21 00:34:03 +00:00
' <div class="line-num1"></div>\n' +
'<div class="line-num2">1</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2019-11-26 16:07:53 +00:00
' <td class="d2h-ins d2h-change">\n' +
' <div class="d2h-code-line d2h-ins d2h-change">\n' +
2016-04-25 16:12:27 +00:00
' <span class="d2h-code-line-prefix">+</span>\n' +
' <span class="d2h-code-line-ctn"><ins>test1</ins></span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </div>\n" +
" </div>\n" +
"</div>\n" +
"</div>" ;
2016-04-25 16:12:27 +00:00
2019-10-06 20:04:33 +00:00
const htmlLineExample1WithFilesSummary = filesExample1 + htmlLineExample1 ;
2016-04-25 16:12:27 +00:00
2019-10-06 20:04:33 +00:00
const htmlSideExample1 =
2016-04-25 16:12:27 +00:00
'<div class="d2h-wrapper">\n' +
2016-05-21 00:34:03 +00:00
' <div id="d2h-675094" class="d2h-file-wrapper" data-lang="">\n' +
' <div class="d2h-file-header">\n' +
' <span class="d2h-file-name-wrapper">\n' +
2018-11-18 15:38:46 +00:00
' <svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">\n' +
' <path d="M6 5H2v-1h4v1zM2 8h7v-1H2v1z m0 2h7v-1H2v1z m0 2h7v-1H2v1z m10-7.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h7.5l3.5 3.5z m-1 0.5L8 2H1v12h10V5z"></path>\n' +
' </svg> <span class="d2h-file-name">sample</span>\n' +
2016-05-21 00:34:03 +00:00
' <span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span></span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
2016-05-21 00:34:03 +00:00
' <div class="d2h-files-diff">\n' +
' <div class="d2h-file-side-diff">\n' +
' <div class="d2h-code-wrapper">\n' +
' <table class="d2h-diff-table">\n' +
' <tbody class="d2h-diff-tbody">\n' +
2019-10-06 20:04:33 +00:00
" <tr>\n" +
2016-05-21 00:34:03 +00:00
' <td class="d2h-code-side-linenumber d2h-info"></td>\n' +
' <td class="d2h-info">\n' +
' <div class="d2h-code-side-line d2h-info">@@ -1 +1 @@</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
"</tr><tr>\n" +
2019-11-26 19:02:25 +00:00
' <td class="d2h-code-side-linenumber d2h-del d2h-change">\n' +
2019-10-06 20:04:33 +00:00
" 1\n" +
" </td>\n" +
2019-11-26 19:02:25 +00:00
' <td class="d2h-del d2h-change">\n' +
' <div class="d2h-code-side-line d2h-del d2h-change">\n' +
2016-05-21 00:34:03 +00:00
' <span class="d2h-code-line-prefix">-</span>\n' +
' <span class="d2h-code-line-ctn"><del>test</del></span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </div>\n" +
" </div>\n" +
2016-05-21 00:34:03 +00:00
' <div class="d2h-file-side-diff">\n' +
' <div class="d2h-code-wrapper">\n' +
' <table class="d2h-diff-table">\n' +
' <tbody class="d2h-diff-tbody">\n' +
2019-10-06 20:04:33 +00:00
" <tr>\n" +
2016-05-21 00:34:03 +00:00
' <td class="d2h-code-side-linenumber d2h-info"></td>\n' +
' <td class="d2h-info">\n' +
' <div class="d2h-code-side-line d2h-info"></div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
"</tr><tr>\n" +
2019-11-26 19:02:25 +00:00
' <td class="d2h-code-side-linenumber d2h-ins d2h-change">\n' +
2019-10-06 20:04:33 +00:00
" 1\n" +
" </td>\n" +
2019-11-26 19:02:25 +00:00
' <td class="d2h-ins d2h-change">\n' +
' <div class="d2h-code-side-line d2h-ins d2h-change">\n' +
2016-05-21 00:34:03 +00:00
' <span class="d2h-code-line-prefix">+</span>\n' +
' <span class="d2h-code-line-ctn"><ins>test1</ins></span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
"</div>\n" +
"</div>" ;
2016-04-25 16:12:27 +00:00
2019-10-06 20:04:33 +00:00
const htmlSideExample1WithFilesSummary = filesExample1 + htmlSideExample1 ;
2016-04-25 16:12:27 +00:00
2019-10-12 21:45:49 +00:00
describe ( "Diff2Html" , ( ) = > {
describe ( "getJsonFromDiff" , ( ) = > {
it ( "should parse simple diff to json" , ( ) = > {
2019-10-06 20:04:33 +00:00
const diff =
"diff --git a/sample b/sample\n" +
"index 0000001..0ddf2ba\n" +
"--- a/sample\n" +
"+++ b/sample\n" +
"@@ -1 +1 @@\n" +
"-test\n" +
"+test1\n" ;
2019-10-12 21:45:49 +00:00
const result = parse ( diff ) ;
2016-04-25 16:12:27 +00:00
2019-10-06 20:04:33 +00:00
const file1 = result [ 0 ] ;
2019-10-12 21:45:49 +00:00
expect ( result . length ) . toEqual ( 1 ) ;
expect ( file1 . addedLines ) . toEqual ( 1 ) ;
expect ( file1 . deletedLines ) . toEqual ( 1 ) ;
expect ( file1 . oldName ) . toEqual ( "sample" ) ;
expect ( file1 . newName ) . toEqual ( "sample" ) ;
expect ( file1 . blocks . length ) . toEqual ( 1 ) ;
2015-12-23 13:12:32 +00:00
} ) ;
2016-01-16 21:51:10 +00:00
// Test case for issue #49
2019-10-12 21:45:49 +00:00
it ( "should parse diff with added EOF" , ( ) = > {
2019-10-06 20:04:33 +00:00
const diff =
"diff --git a/sample.scala b/sample.scala\n" +
"index b583263..8b2fc3e 100644\n" +
"--- a/b583263..8b2fc3e\n" +
"+++ b/8b2fc3e\n" +
"@@ -50,5 +50,7 @@ case class Response[+A](value: Option[A],\n" +
" object ResponseErrorCode extends JsonEnumeration {\n" +
" val NoError, ServiceError, JsonError,\n" +
" InvalidPermissions, MissingPermissions, GenericError,\n" +
"- TokenRevoked, MissingToken = Value\n" +
"-}\n" +
"\\ No newline at end of file\n" +
"+ TokenRevoked, MissingToken,\n" +
"+ IndexLock, RepositoryError, NotValidRepo, PullRequestNotMergeable, BranchError,\n" +
"+ PluginError, CodeParserError, EngineError = Value\n" +
"+}\n" ;
2019-10-12 21:45:49 +00:00
const result = parse ( diff ) ;
2016-01-16 21:51:10 +00:00
2019-10-12 21:45:49 +00:00
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 0 ] . oldNumber ) . toEqual ( 50 ) ;
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 0 ] . newNumber ) . toEqual ( 50 ) ;
2016-01-16 21:51:10 +00:00
2019-10-12 21:45:49 +00:00
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 1 ] . oldNumber ) . toEqual ( 51 ) ;
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 1 ] . newNumber ) . toEqual ( 51 ) ;
2016-01-16 21:51:10 +00:00
2019-10-12 21:45:49 +00:00
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 2 ] . oldNumber ) . toEqual ( 52 ) ;
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 2 ] . newNumber ) . toEqual ( 52 ) ;
2016-01-16 21:51:10 +00:00
2019-10-12 21:45:49 +00:00
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 3 ] . oldNumber ) . toEqual ( 53 ) ;
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 3 ] . newNumber ) . toBeUndefined ( ) ;
2016-01-16 21:51:10 +00:00
2019-10-12 21:45:49 +00:00
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 4 ] . oldNumber ) . toEqual ( 54 ) ;
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 4 ] . newNumber ) . toBeUndefined ( ) ;
2016-01-16 21:51:10 +00:00
2019-10-12 21:45:49 +00:00
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 5 ] . oldNumber ) . toBeUndefined ( ) ;
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 5 ] . newNumber ) . toEqual ( 53 ) ;
2016-01-16 21:51:10 +00:00
2019-10-12 21:45:49 +00:00
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 6 ] . oldNumber ) . toBeUndefined ( ) ;
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 6 ] . newNumber ) . toEqual ( 54 ) ;
2016-01-16 21:51:10 +00:00
2019-10-12 21:45:49 +00:00
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 7 ] . oldNumber ) . toBeUndefined ( ) ;
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 7 ] . newNumber ) . toEqual ( 55 ) ;
2016-01-16 21:51:10 +00:00
2019-10-12 21:45:49 +00:00
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 8 ] . oldNumber ) . toBeUndefined ( ) ;
expect ( result [ 0 ] . blocks [ 0 ] . lines [ 8 ] . newNumber ) . toEqual ( 56 ) ;
2016-01-16 21:51:10 +00:00
} ) ;
2016-04-25 16:12:27 +00:00
2019-10-12 21:45:49 +00:00
it ( "should generate pretty line by line html from diff" , ( ) = > {
2019-10-13 18:21:19 +00:00
const result = html ( diffExample1 , { drawFileList : false } ) ;
2019-10-12 21:45:49 +00:00
expect ( result ) . toEqual ( htmlLineExample1 ) ;
2016-04-25 16:12:27 +00:00
} ) ;
2019-10-12 21:45:49 +00:00
it ( "should generate pretty line by line html from json" , ( ) = > {
2019-10-13 18:21:19 +00:00
const result = html ( jsonExample1 , { drawFileList : false } ) ;
2019-10-12 21:45:49 +00:00
expect ( result ) . toEqual ( htmlLineExample1 ) ;
2016-04-25 16:12:27 +00:00
} ) ;
2019-10-12 21:45:49 +00:00
it ( "should generate pretty diff with files summary" , ( ) = > {
2019-10-13 18:21:19 +00:00
const result = html ( diffExample1 , { drawFileList : true } ) ;
2019-10-12 21:45:49 +00:00
expect ( result ) . toEqual ( htmlLineExample1WithFilesSummary ) ;
2016-04-25 16:12:27 +00:00
} ) ;
2019-10-12 21:45:49 +00:00
it ( "should generate pretty side by side html from diff" , ( ) = > {
2019-10-21 22:37:42 +00:00
const result = html ( diffExample1 , { outputFormat : OutputFormatType.SIDE_BY_SIDE , drawFileList : false } ) ;
2019-10-12 21:45:49 +00:00
expect ( result ) . toEqual ( htmlSideExample1 ) ;
2016-04-25 16:12:27 +00:00
} ) ;
2019-10-12 21:45:49 +00:00
it ( "should generate pretty side by side html from json" , ( ) = > {
2019-10-21 22:37:42 +00:00
const result = html ( jsonExample1 , { outputFormat : OutputFormatType.SIDE_BY_SIDE , drawFileList : false } ) ;
2019-10-12 21:45:49 +00:00
expect ( result ) . toEqual ( htmlSideExample1 ) ;
2016-04-25 16:12:27 +00:00
} ) ;
2019-10-12 21:45:49 +00:00
it ( "should generate pretty side by side html from diff 2" , ( ) = > {
2019-10-21 22:37:42 +00:00
const result = html ( diffExample1 , { outputFormat : OutputFormatType.SIDE_BY_SIDE , drawFileList : true } ) ;
2019-10-12 21:45:49 +00:00
expect ( result ) . toEqual ( htmlSideExample1WithFilesSummary ) ;
2016-04-25 16:12:27 +00:00
} ) ;
2017-03-17 23:57:09 +00:00
2019-10-12 21:45:49 +00:00
it ( "should generate pretty side by side html from diff with html on headers" , ( ) = > {
2019-10-06 20:04:33 +00:00
const diffExample2 =
"diff --git a/CHANGELOG.md b/CHANGELOG.md\n" +
"index fc3e3f4..b486d10 100644\n" +
"--- a/CHANGELOG.md\n" +
"+++ b/CHANGELOG.md\n" +
"@@ -1,7 +1,6 @@\n" +
" # Change Log\n" +
" All notable changes to this project will be documented in this file.\n" +
" This project adheres to [Semantic Versioning](http://semver.org/).\n" +
2017-03-17 23:57:09 +00:00
'-$a="<table><tr><td>Use the following format for additions: ` - VERSION: [feature/patch (if applicable)] Short description of change. Links to relevant issues/PRs.`\n' +
' $a="<table><tr><td>\n' +
" $a=\"<table><tr><td>- 1.1.9: Fix around ubuntu's inability to cache promises. [#877](https://github.com/FredrikNoren/ungit/pull/878)\n" +
2019-10-06 20:04:33 +00:00
" - 1.1.8:\n" +
2019-11-26 09:44:09 +00:00
"@@ -11,7 +10,7 @@ $a="<table><tr><td>- 1.1.9: Fix around ubuntu's inability to cache promises. [#8\n" +
2019-10-06 20:04:33 +00:00
" - 1.1.7:\n" +
" - Fix diff flickering issue and optimization [#865](https://github.com/FredrikNoren/ungit/pull/865)\n" +
" - Fix credential dialog issue [#864](https://github.com/FredrikNoren/ungit/pull/864)\n" +
"- - Fix HEAD branch order when redraw [#858](https://github.com/FredrikNoren/ungit/issues/858)\n" +
"+4 - Fix HEAD branch order when redraw [#858](https://github.com/FredrikNoren/ungit/issues/858)\n" +
" - 1.1.6: Fix path auto complete [#861](https://github.com/FredrikNoren/ungit/issues/861)\n" +
2017-03-17 23:57:09 +00:00
' - 1.1.5: Update "Toggle all" button after commit or changing selected files [#859](https://github.com/FredrikNoren/ungit/issues/859)\n' +
2019-10-06 20:04:33 +00:00
" - 1.1.4: [patch] Promise refactoring\n" +
" \n" ;
2017-03-17 23:57:09 +00:00
2019-10-06 20:04:33 +00:00
const htmlExample2 =
'<div class="d2h-wrapper">\n' +
2017-03-17 23:57:09 +00:00
' <div id="d2h-211439" class="d2h-file-wrapper" data-lang="md">\n' +
' <div class="d2h-file-header">\n' +
' <span class="d2h-file-name-wrapper">\n' +
2018-11-18 15:38:46 +00:00
' <svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">\n' +
' <path d="M6 5H2v-1h4v1zM2 8h7v-1H2v1z m0 2h7v-1H2v1z m0 2h7v-1H2v1z m10-7.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h7.5l3.5 3.5z m-1 0.5L8 2H1v12h10V5z"></path>\n' +
' </svg> <span class="d2h-file-name">CHANGELOG.md</span>\n' +
2017-03-17 23:57:09 +00:00
' <span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span></span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
2017-03-17 23:57:09 +00:00
' <div class="d2h-file-diff">\n' +
' <div class="d2h-code-wrapper">\n' +
' <table class="d2h-diff-table">\n' +
' <tbody class="d2h-diff-tbody">\n' +
2019-10-06 20:04:33 +00:00
" <tr>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-code-linenumber d2h-info"></td>\n' +
' <td class="d2h-info">\n' +
' <div class="d2h-code-line d2h-info">@@ -1,7 +1,6 @@</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
"</tr><tr>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-code-linenumber d2h-cntx">\n' +
' <div class="line-num1">1</div>\n' +
'<div class="line-num2">1</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-cntx">\n' +
' <div class="d2h-code-line d2h-cntx">\n' +
2019-07-06 17:51:50 +00:00
' <span class="d2h-code-line-prefix"> </span>\n' +
2017-03-17 23:57:09 +00:00
' <span class="d2h-code-line-ctn"># Change Log</span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr><tr>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-code-linenumber d2h-cntx">\n' +
' <div class="line-num1">2</div>\n' +
'<div class="line-num2">2</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-cntx">\n' +
' <div class="d2h-code-line d2h-cntx">\n' +
2019-07-06 17:51:50 +00:00
' <span class="d2h-code-line-prefix"> </span>\n' +
2017-03-17 23:57:09 +00:00
' <span class="d2h-code-line-ctn">All notable changes to this project will be documented in this file.</span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr><tr>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-code-linenumber d2h-cntx">\n' +
' <div class="line-num1">3</div>\n' +
'<div class="line-num2">3</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-cntx">\n' +
' <div class="d2h-code-line d2h-cntx">\n' +
2019-07-06 17:51:50 +00:00
' <span class="d2h-code-line-prefix"> </span>\n' +
2017-03-17 23:57:09 +00:00
' <span class="d2h-code-line-ctn">This project adheres to [Semantic Versioning](http://semver.org/).</span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr><tr>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-code-linenumber d2h-del">\n' +
' <div class="line-num1">4</div>\n' +
'<div class="line-num2"></div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-del">\n' +
' <div class="d2h-code-line d2h-del">\n' +
' <span class="d2h-code-line-prefix">-</span>\n' +
' <span class="d2h-code-line-ctn">$a="<table><tr><td>Use the following format for additions: ` - VERSION: [feature/patch (if applicable)] Short description of change. Links to relevant issues/PRs.`</span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr><tr>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-code-linenumber d2h-cntx">\n' +
' <div class="line-num1">5</div>\n' +
'<div class="line-num2">4</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-cntx">\n' +
' <div class="d2h-code-line d2h-cntx">\n' +
2019-07-06 17:51:50 +00:00
' <span class="d2h-code-line-prefix"> </span>\n' +
2017-03-17 23:57:09 +00:00
' <span class="d2h-code-line-ctn">$a="<table><tr><td></span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr><tr>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-code-linenumber d2h-cntx">\n' +
' <div class="line-num1">6</div>\n' +
'<div class="line-num2">5</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-cntx">\n' +
' <div class="d2h-code-line d2h-cntx">\n' +
2019-07-06 17:51:50 +00:00
' <span class="d2h-code-line-prefix"> </span>\n' +
2017-03-17 23:57:09 +00:00
' <span class="d2h-code-line-ctn">$a="<table><tr><td>- 1.1.9: Fix around ubuntu's inability to cache promises. [#877](https://github.com/FredrikNoren/ungit/pull/878)</span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr><tr>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-code-linenumber d2h-cntx">\n' +
' <div class="line-num1">7</div>\n' +
'<div class="line-num2">6</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-cntx">\n' +
' <div class="d2h-code-line d2h-cntx">\n' +
2019-07-06 17:51:50 +00:00
' <span class="d2h-code-line-prefix"> </span>\n' +
2017-03-17 23:57:09 +00:00
' <span class="d2h-code-line-ctn">- 1.1.8:</span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr>\n" +
"<tr>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-code-linenumber d2h-info"></td>\n' +
' <td class="d2h-info">\n' +
' <div class="d2h-code-line d2h-info">@@ -11,7 +10,7 @@ $a="<table><tr><td>- 1.1.9: Fix around ubuntu's inability to cache promises. [#8</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
"</tr><tr>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-code-linenumber d2h-cntx">\n' +
' <div class="line-num1">11</div>\n' +
'<div class="line-num2">10</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-cntx">\n' +
' <div class="d2h-code-line d2h-cntx">\n' +
2019-07-06 17:51:50 +00:00
' <span class="d2h-code-line-prefix"> </span>\n' +
2017-03-17 23:57:09 +00:00
' <span class="d2h-code-line-ctn">- 1.1.7:</span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr><tr>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-code-linenumber d2h-cntx">\n' +
' <div class="line-num1">12</div>\n' +
'<div class="line-num2">11</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-cntx">\n' +
' <div class="d2h-code-line d2h-cntx">\n' +
2019-07-06 17:51:50 +00:00
' <span class="d2h-code-line-prefix"> </span>\n' +
2017-03-17 23:57:09 +00:00
' <span class="d2h-code-line-ctn"> - Fix diff flickering issue and optimization [#865](https://github.com/FredrikNoren/ungit/pull/865)</span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr><tr>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-code-linenumber d2h-cntx">\n' +
' <div class="line-num1">13</div>\n' +
'<div class="line-num2">12</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-cntx">\n' +
' <div class="d2h-code-line d2h-cntx">\n' +
2019-07-06 17:51:50 +00:00
' <span class="d2h-code-line-prefix"> </span>\n' +
2017-03-17 23:57:09 +00:00
' <span class="d2h-code-line-ctn"> - Fix credential dialog issue [#864](https://github.com/FredrikNoren/ungit/pull/864)</span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr><tr>\n" +
2019-11-26 16:07:53 +00:00
' <td class="d2h-code-linenumber d2h-del d2h-change">\n' +
2017-03-17 23:57:09 +00:00
' <div class="line-num1">14</div>\n' +
'<div class="line-num2"></div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2019-11-26 16:07:53 +00:00
' <td class="d2h-del d2h-change">\n' +
' <div class="d2h-code-line d2h-del d2h-change">\n' +
2017-03-17 23:57:09 +00:00
' <span class="d2h-code-line-prefix">-</span>\n' +
' <span class="d2h-code-line-ctn"> - Fix HEAD branch order when redraw [#858](https://github.com/FredrikNoren/ungit/issues/858)</span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr><tr>\n" +
2019-11-26 16:07:53 +00:00
' <td class="d2h-code-linenumber d2h-ins d2h-change">\n' +
2017-03-17 23:57:09 +00:00
' <div class="line-num1"></div>\n' +
'<div class="line-num2">13</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2019-11-26 16:07:53 +00:00
' <td class="d2h-ins d2h-change">\n' +
' <div class="d2h-code-line d2h-ins d2h-change">\n' +
2017-03-17 23:57:09 +00:00
' <span class="d2h-code-line-prefix">+</span>\n' +
' <span class="d2h-code-line-ctn"><ins>4</ins> - Fix HEAD branch order when redraw [#858](https://github.com/FredrikNoren/ungit/issues/858)</span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr><tr>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-code-linenumber d2h-cntx">\n' +
' <div class="line-num1">15</div>\n' +
'<div class="line-num2">14</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-cntx">\n' +
' <div class="d2h-code-line d2h-cntx">\n' +
2019-07-06 17:51:50 +00:00
' <span class="d2h-code-line-prefix"> </span>\n' +
2017-03-17 23:57:09 +00:00
' <span class="d2h-code-line-ctn">- 1.1.6: Fix path auto complete [#861](https://github.com/FredrikNoren/ungit/issues/861)</span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr><tr>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-code-linenumber d2h-cntx">\n' +
' <div class="line-num1">16</div>\n' +
'<div class="line-num2">15</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-cntx">\n' +
' <div class="d2h-code-line d2h-cntx">\n' +
2019-07-06 17:51:50 +00:00
' <span class="d2h-code-line-prefix"> </span>\n' +
2017-03-17 23:57:09 +00:00
' <span class="d2h-code-line-ctn">- 1.1.5: Update "Toggle all" button after commit or changing selected files [#859](https://github.com/FredrikNoren/ungit/issues/859)</span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr><tr>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-code-linenumber d2h-cntx">\n' +
' <div class="line-num1">17</div>\n' +
'<div class="line-num2">16</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-cntx">\n' +
' <div class="d2h-code-line d2h-cntx">\n' +
2019-07-06 17:51:50 +00:00
' <span class="d2h-code-line-prefix"> </span>\n' +
2017-03-17 23:57:09 +00:00
' <span class="d2h-code-line-ctn">- 1.1.4: [patch] Promise refactoring</span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr><tr>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-code-linenumber d2h-cntx">\n' +
' <div class="line-num1">18</div>\n' +
'<div class="line-num2">17</div>\n' +
2019-10-06 20:04:33 +00:00
" </td>\n" +
2017-03-17 23:57:09 +00:00
' <td class="d2h-cntx">\n' +
' <div class="d2h-code-line d2h-cntx">\n' +
2019-07-06 17:51:50 +00:00
' <span class="d2h-code-line-prefix"> </span>\n' +
2019-10-06 20:04:33 +00:00
" </div>\n" +
" </td>\n" +
"</tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </div>\n" +
" </div>\n" +
"</div>\n" +
"</div>" ;
2017-03-17 23:57:09 +00:00
2019-10-13 18:21:19 +00:00
const result = html ( diffExample2 , { drawFileList : false } ) ;
2019-11-26 16:07:53 +00:00
expect ( result ) . toEqual ( htmlExample2 ) ;
2017-03-17 23:57:09 +00:00
} ) ;
2015-12-23 13:12:32 +00:00
} ) ;
} ) ;