branch testing

pull/4791/head
Your Name 6 months ago
parent fb9c7f57b2
commit d769014d60
  1. 32
      apps/remix-ide-e2e/src/tests/dgit_local.test.ts
  2. 7
      libs/remix-ui/git/src/components/buttons/commitmessage.tsx

@ -182,9 +182,41 @@ module.exports = {
.setValue('*[data-id="newbranchname"]', 'testbranch')
.click('*[data-id="sourcecontrol-create-branch"]')
.waitForElementVisible('*[data-id="branches-current-branch-testbranch"]')
.pause(1000)
},
'publish the branch #group2': function (browser: NightwatchBrowser) {
browser
.waitForElementVisible('*[data-id="sourcecontrol-panel"]')
.click('*[data-id="sourcecontrol-panel"]')
.pause(1000)
.click('*[data-id="publishBranchButton"]')
.pause(2000)
.waitForElementNotVisible('*[data-id="publishBranchButton"]')
},
'check if the branch is published #group2': async function (browser: NightwatchBrowser) {
const branches = await getBranches('/tmp/git/bare.git')
browser.assert.ok(branches.includes('testbranch'))
}
}
async function getBranches(path: string): Promise<string> {
return new Promise((resolve, reject) => {
const git = spawn('git', ['branch'], { cwd: path })
let branches = ''
git.stdout.on('data', function (data) {
console.log('stdout git branches', data.toString())
branches += data.toString()
})
git.stderr.on('data', function (data) {
console.log('stderr git branches', data.toString())
reject(data.toString())
})
git.on('close', function () {
resolve(branches)
})
})
}
async function getGitLog(path: string): Promise<string> {
return new Promise((resolve, reject) => {
const git = spawn('git', ['log'], { cwd: path })

@ -86,10 +86,13 @@ export const CommitMessage = () => {
remote: getRemote(),
ref: context.currentBranch
})
await actions.pull({
await actions.fetch({
remote: getRemote(),
ref: context.currentBranch
ref: context.currentBranch,
singleBranch: false,
relative: true
})
}
const messageEnabled = () => {

Loading…
Cancel
Save