diff --git a/apps/remix-ide-e2e/src/tests/dgit_local.test.ts b/apps/remix-ide-e2e/src/tests/dgit_local.test.ts index ad2f052e33..0a8a2d8f96 100644 --- a/apps/remix-ide-e2e/src/tests/dgit_local.test.ts +++ b/apps/remix-ide-e2e/src/tests/dgit_local.test.ts @@ -23,7 +23,7 @@ module.exports = { done() }) }, - 'Update settings for git': function (browser) { + 'Update settings for git #group1': function (browser) { browser. clickLaunchIcon('dgit') .waitForElementVisible('*[data-id="initgit-btn"]') @@ -34,7 +34,7 @@ module.exports = { .modalFooterOKClick('github-credentials-error') .pause(2000) }, - 'clone a repo': function (browser) { + 'clone a repo #group1': function (browser) { browser .waitForElementVisible('*[data-id="clone-panel"]') .click('*[data-id="clone-panel"]') @@ -44,8 +44,33 @@ module.exports = { .click('*[data-id="clone-btn"]') .clickLaunchIcon('filePanel') .waitForElementVisible('*[data-id="treeViewLitreeViewItemREADME.md"]') - .addFile('testFile.text', { content: 'hello world' }, 'README.md') - .pause(10000) + + }, + 'check file added #group1': function (browser) { + browser. + addFile('test.txt', { content: 'hello world' }, 'README.md') + .clickLaunchIcon('dgit') + .click('*[data-id="sourcecontrol-panel"]') + .waitForElementVisible({ + selector: "//*[@data-status='new-untracked' and @data-file='/test.txt']", + locateStrategy: 'xpath' + }) + .waitForElementVisible('*[data-id="addToGitChangestest.txt"]') + .click('*[data-id="addToGitChangestest.txt"]') + .waitForElementVisible({ + selector: "//*[@data-status='added-staged' and @data-file='/test.txt']", + locateStrategy: 'xpath' + }) + .setValue('*[data-id="commitMessage"]', 'testcommit') + .click('*[data-id="commitButton"]') + }, + 'look at the commit #group1': function (browser) { + browser + .click('*[data-id="commits-panel"]') + .waitForElementPresent({ + selector: '//*[@data-id="commit-summary-testcommit-ahead"]', + locateStrategy: 'xpath' + }) } } diff --git a/libs/remix-ui/git/src/components/navigation/commits.tsx b/libs/remix-ui/git/src/components/navigation/commits.tsx index 536c99a0c4..8936fe30ec 100644 --- a/libs/remix-ui/git/src/components/navigation/commits.tsx +++ b/libs/remix-ui/git/src/components/navigation/commits.tsx @@ -42,7 +42,7 @@ export const CommitsNavigation = ({ eventKey, activePanel, callback, title, bran return ( <>
- handleClick()} role={'button'} className='nav d-flex justify-content-start align-items-center w-100'> + handleClick()} role={'button'} className='nav d-flex justify-content-start align-items-center w-100'> { activePanel === eventKey ? : } diff --git a/libs/remix-ui/git/src/components/navigation/sourcecontrol.tsx b/libs/remix-ui/git/src/components/navigation/sourcecontrol.tsx index ee31346eef..e6eb60a36c 100644 --- a/libs/remix-ui/git/src/components/navigation/sourcecontrol.tsx +++ b/libs/remix-ui/git/src/components/navigation/sourcecontrol.tsx @@ -25,7 +25,7 @@ export const SourceControlNavigation = ({ eventKey, activePanel, callback }) => return ( <>
- handleClick()} role={'button'} className='nav d-flex justify-content-start align-items-center w-75'> + handleClick()} role={'button'} className='nav d-flex justify-content-start align-items-center w-75'> { activePanel === eventKey ? : } diff --git a/libs/remix-ui/git/src/components/panels/commits/commitdetailsitem.tsx b/libs/remix-ui/git/src/components/panels/commits/commitdetailsitem.tsx index 8fc2591e21..092d8994c8 100644 --- a/libs/remix-ui/git/src/components/panels/commits/commitdetailsitem.tsx +++ b/libs/remix-ui/git/src/components/panels/commits/commitdetailsitem.tsx @@ -36,7 +36,7 @@ export const CommitDetailsItems = (props: CCommitDetailsItemsProps) => { ) } return (<> -
+
await openChanges(commitChange)}> {path.basename(commitChange.path)}
{commitChange.path}
diff --git a/libs/remix-ui/git/src/components/panels/commits/commitsummary.tsx b/libs/remix-ui/git/src/components/panels/commits/commitsummary.tsx index 79caa2de6a..31a36a3f6a 100644 --- a/libs/remix-ui/git/src/components/panels/commits/commitsummary.tsx +++ b/libs/remix-ui/git/src/components/panels/commits/commitsummary.tsx @@ -28,10 +28,10 @@ export const CommitSummary = (props: CommitSummaryProps) => { return "today at " + dateFormat(timestamp * 1000, "HH:MM"); } else - if (diff < 1) { - // return how many hours ago - return `${Math.floor(diff * 24)} hour(s) ago`; - } + if (diff < 1) { + // return how many hours ago + return `${Math.floor(diff * 24)} hour(s) ago`; + } if (diff < 7) { // return how many days ago @@ -53,10 +53,13 @@ export const CommitSummary = (props: CommitSummaryProps) => { if (getRemote()) window.open(`${getRemote().url}/commit/${commit.oid}`, '_blank'); } + function removeLineBreaks(str: string): string { + return str.replace(/(\r\n|\n|\r)/gm, ''); + } return ( <> -
+
{commit.commit.message}
{commit.commit.author.name || ""} diff --git a/libs/remix-ui/git/src/components/panels/sourcecontrol/sourcecontrolitem.tsx b/libs/remix-ui/git/src/components/panels/sourcecontrol/sourcecontrolitem.tsx index a8568eec50..dc38133240 100644 --- a/libs/remix-ui/git/src/components/panels/sourcecontrol/sourcecontrolitem.tsx +++ b/libs/remix-ui/git/src/components/panels/sourcecontrol/sourcecontrolitem.tsx @@ -49,7 +49,7 @@ export const SourceControlItem = (props: SourceControlItemProps) => { } return (<> -
+
await fileClick(file)}> {path.basename(file.filename)}
{file.filename}