diff --git a/apps/remix-ide-e2e/src/tests/dgit_github.test.ts b/apps/remix-ide-e2e/src/tests/dgit_github.test.ts index da38485359..9b67794bab 100644 --- a/apps/remix-ide-e2e/src/tests/dgit_github.test.ts +++ b/apps/remix-ide-e2e/src/tests/dgit_github.test.ts @@ -310,4 +310,66 @@ module.exports = { } }) }, + // pagination test + 'clone repo #group3': function (browser: NightwatchBrowser) { + browser. + clickLaunchIcon('dgit') + .waitForElementVisible('*[data-id="clone-url"]') + .setValue('*[data-id="clone-url"]', 'https://github.com/ethereum/awesome-remix') + .waitForElementVisible('*[data-id="clone-branch"]') + .setValue('*[data-id="clone-branch"]', 'master') + .waitForElementVisible('*[data-id="clone-btn"]') + .click('*[data-id="clone-btn"]') + .clickLaunchIcon('filePanel') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemREADME.md"]') + }, + 'Update settings for git #group3': function (browser: NightwatchBrowser) { + browser. + clickLaunchIcon('dgit') + .setValue('*[data-id="githubToken"]', 'invalidtoken') + .setValue('*[data-id="gitubUsername"]', 'git') + .setValue('*[data-id="githubEmail"]', 'git@example.com') + .click('*[data-id="saveGitHubCredentials"]') + .modalFooterOKClick('github-credentials-error') + }, + 'check the commits panel for pagination #group3': function (browser: NightwatchBrowser) { + browser + .waitForElementVisible('*[data-id="commits-panel"]') + .click('*[data-id="commits-panel"]') + .elements('xpath', '//*[@data-id="commits-current-branch-master"]//*[@data-type="commit-summary"]', function (result) { + console.log('Number of commit-summary elements:', (result.value as any).length); + browser.assert.ok((result.value as any).length == 1) + }) + }, + 'load more commits #group3': function (browser: NightwatchBrowser) { + browser + .waitForElementVisible('*[data-id="load-more-commits"]') + .click('*[data-id="load-more-commits"]') + .waitForElementVisible('*[data-id="loader-indicator"]') + .waitForElementNotPresent('*[data-id="loader-indicator"]') + .elements('xpath', '//*[@data-id="commits-current-branch-master"]//*[@data-type="commit-summary"]', function (result) { + console.log('Number of commit-summary elements:', (result.value as any).length); + browser.assert.ok((result.value as any).length > 2) + }) + }, + 'load more branches from remote #group3': function (browser: NightwatchBrowser) { + browser + .click('*[data-id="branches-panel"]') + .waitForElementVisible({ + selector: '//*[@data-id="branches-panel-content-remote-branches"]', + locateStrategy: 'xpath' + }) + .elements('xpath', '//*[@data-id="branches-panel-content-remote-branches"]//*[@data-type="branches-branch"]', function (result) { + console.log('Number of branches elements:', (result.value as any).length); + browser.assert.ok((result.value as any).length == 1) + }) + .waitForElementVisible('*[data-id="remote-sync-origin"]') + .click('*[data-id="remote-sync-origin"]') + .waitForElementVisible('*[data-id="loader-indicator"]') + .waitForElementNotPresent('*[data-id="loader-indicator"]') + .elements('xpath', '//*[@data-id="branches-panel-content-remote-branches"]//*[@data-type="branches-branch"]', function (result) { + console.log('Number of branches elements:', (result.value as any).length); + browser.assert.ok((result.value as any).length > 2) + }) + } } diff --git a/libs/remix-ui/git/src/components/navigation/branchedetails.tsx b/libs/remix-ui/git/src/components/navigation/branchedetails.tsx index 2407e5a071..9de954fc94 100644 --- a/libs/remix-ui/git/src/components/navigation/branchedetails.tsx +++ b/libs/remix-ui/git/src/components/navigation/branchedetails.tsx @@ -64,7 +64,7 @@ export const BrancheDetailsNavigation = (props: BrancheDetailsNavigationProps) = return ( <>
-
handleClick()} role={'button'} className='pointer d-flex flex-row w-100 commit-navigation'> +
handleClick()} role={'button'} className='pointer d-flex flex-row w-100 commit-navigation'> { activePanel === eventKey ? : } diff --git a/libs/remix-ui/git/src/components/navigation/loaderindicator.tsx b/libs/remix-ui/git/src/components/navigation/loaderindicator.tsx index 8c13e101b3..ee5e44aff0 100644 --- a/libs/remix-ui/git/src/components/navigation/loaderindicator.tsx +++ b/libs/remix-ui/git/src/components/navigation/loaderindicator.tsx @@ -13,7 +13,7 @@ const LoaderIndicator = ({ type, isLoadingCondition }: LoaderIndicatorProps) => const isLoading = loading || isLoadingCondition if (!isLoading) return null return ( - + ); }; diff --git a/libs/remix-ui/git/src/components/panels/branches/localbranchdetails.tsx b/libs/remix-ui/git/src/components/panels/branches/localbranchdetails.tsx index 2b996a3d34..da592229b3 100644 --- a/libs/remix-ui/git/src/components/panels/branches/localbranchdetails.tsx +++ b/libs/remix-ui/git/src/components/panels/branches/localbranchdetails.tsx @@ -81,7 +81,7 @@ export const LocalBranchDetails = (props: BrancheDetailsProps) => { })}
- {hasNextPage && Load more} + {hasNextPage && Load more} ) diff --git a/libs/remix-ui/git/src/components/panels/branches/remotebranchedetails.tsx b/libs/remix-ui/git/src/components/panels/branches/remotebranchedetails.tsx index d80e999ee1..da97dea0f2 100644 --- a/libs/remix-ui/git/src/components/panels/branches/remotebranchedetails.tsx +++ b/libs/remix-ui/git/src/components/panels/branches/remotebranchedetails.tsx @@ -107,7 +107,7 @@ export const RemoteBranchDetails = (props: BrancheDetailsProps) => { })}
- {hasNextPage && Load more} + {hasNextPage && Load more} ) diff --git a/libs/remix-ui/git/src/components/panels/clone.tsx b/libs/remix-ui/git/src/components/panels/clone.tsx index e7719fe68e..ab3ed7d6cb 100644 --- a/libs/remix-ui/git/src/components/panels/clone.tsx +++ b/libs/remix-ui/git/src/components/panels/clone.tsx @@ -78,7 +78,7 @@ export const Clone = (props: CloneProps) => { onGitHubCloneUrlChange(e.target.value)} aria-describedby="urlprepend" /> - onCloneBranchChange(e.target.value)} value={cloneBranch} className="form-control mb-2 mt-2" placeholder="branch" type="text" id="clonebranch" /> + onCloneBranchChange(e.target.value)} value={cloneBranch} className="form-control mb-2 mt-2" placeholder="branch" type="text" id="clonebranch" /> { clone() }}>clone diff --git a/libs/remix-ui/git/src/components/panels/commits.tsx b/libs/remix-ui/git/src/components/panels/commits.tsx index b2acadbf9c..db2907a1da 100644 --- a/libs/remix-ui/git/src/components/panels/commits.tsx +++ b/libs/remix-ui/git/src/components/panels/commits.tsx @@ -57,7 +57,7 @@ export const Commits = () => { })} - {hasNextPage && Load more} + {hasNextPage && Load more} :
No commits
} 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 bff01b4712..bd1e3a7dbd 100644 --- a/libs/remix-ui/git/src/components/panels/commits/commitsummary.tsx +++ b/libs/remix-ui/git/src/components/panels/commits/commitsummary.tsx @@ -61,7 +61,7 @@ export const CommitSummary = (props: CommitSummaryProps) => { return ( <> -
+
{commit.commit.message}
{commit.commit.author.name || ""}