Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions apps/remix-ide-e2e/src/tests/dgit_github.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ module.exports = {
.waitForElementVisible('*[data-id="connected-link-bunsenstraat"]')
.waitForElementVisible('*[data-id="remotes-panel"]')
},
'check the FE shows logged in user #group1 #group2': function (browser: NightwatchBrowser) {
browser
.waitForElementVisible({
selector: '//*[@data-id="github-dropdown-toggle-login"]//span[contains(text(), "bunsenstraat")]',
locateStrategy: 'xpath'
})
},
// 'check the FE for the auth user #group1 #group2': function (browser: NightwatchBrowser) {
// browser
// .clickLaunchIcon('filePanel')
Expand Down Expand Up @@ -213,16 +220,39 @@ module.exports = {
locateStrategy: 'xpath'
})
},
'disconnect github #group1': function (browser: NightwatchBrowser) {
'reload page and check login persistence #group1': function (browser: NightwatchBrowser) {
browser
.refresh()
.pause(5000) // Wait for page to fully reload
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.clickLaunchIcon('dgit')
.waitForElementVisible('*[data-id="github-panel"]')
.pause(1000)
.click('*[data-id="github-panel"]')
.waitForElementVisible('*[data-id="connected-as-bunsenstraat"]')
.waitForElementVisible('*[data-id="connected-img-bunsenstraat"]')
.waitForElementVisible('*[data-id="connected-link-bunsenstraat"]')
},
'check the FE shows logged in user after reload #group1': function (browser: NightwatchBrowser) {
browser
.waitForElementVisible({
selector: '//*[@data-id="github-dropdown-toggle-login"]//span[contains(text(), "bunsenstraat")]',
locateStrategy: 'xpath'
})
},
'disconnect github #group1': function (browser: NightwatchBrowser) {
browser
.waitForElementVisible('*[data-id="disconnect-github"]')
.pause(1000)
.click('*[data-id="disconnect-github"]')
.waitForElementNotPresent('*[data-id="connected-as-bunsenstraat"]')
},
'check the FE for the disconnected auth user #group1': function (browser: NightwatchBrowser) {
browser
.waitForElementNotPresent({
selector: '//*[@data-id="github-dropdown-toggle-login"]//span[contains(text(), "bunsenstraat")]',
locateStrategy: 'xpath'
})
},
// 'check the FE for the disconnected auth user #group1': function (browser: NightwatchBrowser) {
// browser
// .clickLaunchIcon('filePanel')
Expand Down
6 changes: 6 additions & 0 deletions libs/remix-ui/git/src/lib/listeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ export const setCallBacks = (viewPlugin: Plugin, gitDispatcher: React.Dispatch<g
// Initialize the login plugin reference
setLoginPlugin(viewPlugin)

plugin.call('manager', 'isActive', 'dgitApi').then( (isActive) => {
if (isActive) {
loadGitHubUserFromToken();
}
});

plugin.on("fileManager", "fileSaved", async (file: string) => {
loadFileQueue.enqueue(async () => {
loadFiles()
Expand Down