expand test

pull/4791/head
Your Name 6 months ago
parent 33e90077d3
commit 57cfec6516
  1. 33
      apps/remix-ide-e2e/src/tests/dgit_local.test.ts
  2. 2
      libs/remix-ui/git/src/components/navigation/commits.tsx
  3. 2
      libs/remix-ui/git/src/components/navigation/sourcecontrol.tsx
  4. 2
      libs/remix-ui/git/src/components/panels/commits/commitdetailsitem.tsx
  5. 13
      libs/remix-ui/git/src/components/panels/commits/commitsummary.tsx
  6. 2
      libs/remix-ui/git/src/components/panels/sourcecontrol/sourcecontrolitem.tsx

@ -23,7 +23,7 @@ module.exports = {
done() done()
}) })
}, },
'Update settings for git': function (browser) { 'Update settings for git #group1': function (browser) {
browser. browser.
clickLaunchIcon('dgit') clickLaunchIcon('dgit')
.waitForElementVisible('*[data-id="initgit-btn"]') .waitForElementVisible('*[data-id="initgit-btn"]')
@ -34,7 +34,7 @@ module.exports = {
.modalFooterOKClick('github-credentials-error') .modalFooterOKClick('github-credentials-error')
.pause(2000) .pause(2000)
}, },
'clone a repo': function (browser) { 'clone a repo #group1': function (browser) {
browser browser
.waitForElementVisible('*[data-id="clone-panel"]') .waitForElementVisible('*[data-id="clone-panel"]')
.click('*[data-id="clone-panel"]') .click('*[data-id="clone-panel"]')
@ -44,8 +44,33 @@ module.exports = {
.click('*[data-id="clone-btn"]') .click('*[data-id="clone-btn"]')
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemREADME.md"]') .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'
})
} }
} }

@ -42,7 +42,7 @@ export const CommitsNavigation = ({ eventKey, activePanel, callback, title, bran
return ( return (
<> <>
<div className={`d-flex justify-content-between ${activePanel === eventKey ? 'bg-light' : ''} ${ahead || behind? 'text-success':''}`}> <div className={`d-flex justify-content-between ${activePanel === eventKey ? 'bg-light' : ''} ${ahead || behind? 'text-success':''}`}>
<span onClick={() => handleClick()} role={'button'} className='nav d-flex justify-content-start align-items-center w-100'> <span data-id='commits-panel' onClick={() => handleClick()} role={'button'} className='nav d-flex justify-content-start align-items-center w-100'>
{ {
activePanel === eventKey ? <FontAwesomeIcon className='' icon={faCaretDown}></FontAwesomeIcon> : <FontAwesomeIcon className='' icon={faCaretRight}></FontAwesomeIcon> activePanel === eventKey ? <FontAwesomeIcon className='' icon={faCaretDown}></FontAwesomeIcon> : <FontAwesomeIcon className='' icon={faCaretRight}></FontAwesomeIcon>
} }

@ -25,7 +25,7 @@ export const SourceControlNavigation = ({ eventKey, activePanel, callback }) =>
return ( return (
<> <>
<div className={'d-flex justify-content-between ' + (activePanel === eventKey ? 'bg-light' : '')}> <div className={'d-flex justify-content-between ' + (activePanel === eventKey ? 'bg-light' : '')}>
<span onClick={() => handleClick()} role={'button'} className='nav d-flex justify-content-start align-items-center w-75'> <span data-id='sourcecontrol-panel' onClick={() => handleClick()} role={'button'} className='nav d-flex justify-content-start align-items-center w-75'>
{ {
activePanel === eventKey ? <FontAwesomeIcon className='' icon={faCaretDown}></FontAwesomeIcon> : <FontAwesomeIcon className='' icon={faCaretRight}></FontAwesomeIcon> activePanel === eventKey ? <FontAwesomeIcon className='' icon={faCaretDown}></FontAwesomeIcon> : <FontAwesomeIcon className='' icon={faCaretRight}></FontAwesomeIcon>
} }

@ -36,7 +36,7 @@ export const CommitDetailsItems = (props: CCommitDetailsItemsProps) => {
</>) </>)
} }
return (<> return (<>
<div className={`d-flex w-100 d-flex flex-row commitdetailsitem ${isAheadOfRepo ? 'text-success' : ''}`}> <div data-id={`commit-change-${path.basename(commitChange.path)}`} className={`d-flex w-100 d-flex flex-row commitdetailsitem ${isAheadOfRepo ? 'text-success' : ''}`}>
<div className='pointer gitfile long-and-truncated' onClick={async () => await openChanges(commitChange)}> <div className='pointer gitfile long-and-truncated' onClick={async () => await openChanges(commitChange)}>
<span className='font-weight-bold long-and-truncated'>{path.basename(commitChange.path)}</span> <span className='font-weight-bold long-and-truncated'>{path.basename(commitChange.path)}</span>
<div className='text-secondary long-and-truncated'> {commitChange.path}</div> <div className='text-secondary long-and-truncated'> {commitChange.path}</div>

@ -28,10 +28,10 @@ export const CommitSummary = (props: CommitSummaryProps) => {
return "today at " + dateFormat(timestamp * 1000, "HH:MM"); return "today at " + dateFormat(timestamp * 1000, "HH:MM");
} else } else
if (diff < 1) { if (diff < 1) {
// return how many hours ago // return how many hours ago
return `${Math.floor(diff * 24)} hour(s) ago`; return `${Math.floor(diff * 24)} hour(s) ago`;
} }
if (diff < 7) { if (diff < 7) {
// return how many days ago // return how many days ago
@ -53,10 +53,13 @@ export const CommitSummary = (props: CommitSummaryProps) => {
if (getRemote()) if (getRemote())
window.open(`${getRemote().url}/commit/${commit.oid}`, '_blank'); window.open(`${getRemote().url}/commit/${commit.oid}`, '_blank');
} }
function removeLineBreaks(str: string): string {
return str.replace(/(\r\n|\n|\r)/gm, '');
}
return ( return (
<> <>
<div className="long-and-truncated ml-2"> <div data-id={`commit-summary-${removeLineBreaks(commit.commit.message)}-${isAheadOfRepo ? 'ahead' : null}`} className="long-and-truncated ml-2">
{commit.commit.message} {commit.commit.message}
</div> </div>
{commit.commit.author.name || ""} {commit.commit.author.name || ""}

@ -49,7 +49,7 @@ export const SourceControlItem = (props: SourceControlItemProps) => {
} }
return (<> return (<>
<div className="d-flex w-100 d-flex flex-row align-items-center"> <div data-status={file.statusNames.join('-')} data-file={file.filename} className="d-flex w-100 d-flex flex-row align-items-center">
<div className='pointer gitfile long-and-truncated' onClick={async () => await fileClick(file)}> <div className='pointer gitfile long-and-truncated' onClick={async () => await fileClick(file)}>
<span className='font-weight-bold long-and-truncated'>{path.basename(file.filename)}</span> <span className='font-weight-bold long-and-truncated'>{path.basename(file.filename)}</span>
<div className='text-secondary long-and-truncated'> {file.filename}</div> <div className='text-secondary long-and-truncated'> {file.filename}</div>

Loading…
Cancel
Save