mirror of
				https://git.cloudron.io/cloudron/gitea-app
				synced 2025-11-04 00:52:35 +00:00 
			
		
		
		
	Fixup tests
This commit is contained in:
		
							
								
								
									
										17
									
								
								test/test.js
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								test/test.js
									
									
									
									
									
								
							@@ -75,10 +75,15 @@ describe('Application life cycle test', function () {
 | 
			
		||||
    async function checkAvatar() {
 | 
			
		||||
        await browser.get(`https://${app.fqdn}/${username}`);
 | 
			
		||||
 | 
			
		||||
        var avatarSrc = await browser.findElement(By.xpath('//a[@id="profile-avatar"]/img')).getAttribute('src');
 | 
			
		||||
        let avatarSrc;
 | 
			
		||||
        if (app.manifest.version === '1.24.0') {
 | 
			
		||||
            avatarSrc = await browser.findElement(By.xpath('//div[@id="profile-avatar"]/a/img')).getAttribute('src');
 | 
			
		||||
        } else {
 | 
			
		||||
            avatarSrc = await browser.findElement(By.xpath('//a[@id="profile-avatar"]/img')).getAttribute('src');
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        var avatar = await superagent.get(avatarSrc);
 | 
			
		||||
        expect(avatar.statusCode).to.equal(200);
 | 
			
		||||
        const response = await superagent.get(avatarSrc);
 | 
			
		||||
        expect(response.statusCode).to.equal(200);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async function login(username, password) {
 | 
			
		||||
@@ -153,9 +158,10 @@ describe('Application life cycle test', function () {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function pushFile() {
 | 
			
		||||
        var env = Object.create(process.env);
 | 
			
		||||
        const env = Object.create(process.env);
 | 
			
		||||
        env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh';
 | 
			
		||||
        execSync(`touch newfile && git add newfile && git commit -a -mx && git push ssh://git@${app.fqdn}:${SSH_PORT}/${username}/${reponame} master`,
 | 
			
		||||
        const defaultBranch = app.manifest.version === '1.24.0' ? 'main' : 'master';
 | 
			
		||||
        execSync(`touch newfile && git add newfile && git commit -a -mx && git push ssh://git@${app.fqdn}:${SSH_PORT}/${username}/${reponame} ${defaultBranch}`,
 | 
			
		||||
                 { env: env, cwd: repodir });
 | 
			
		||||
        fs.rmSync(repodir, { recursive: true, force: true });
 | 
			
		||||
    }
 | 
			
		||||
@@ -258,6 +264,7 @@ describe('Application life cycle test', function () {
 | 
			
		||||
    it('can add and push a file', pushFile);
 | 
			
		||||
 | 
			
		||||
    it('can update', function () { execSync('cloudron update --app ' + app.id, EXEC_ARGS); });
 | 
			
		||||
    it('can get app information', getAppInfo);
 | 
			
		||||
 | 
			
		||||
    xit('can admin login', adminLogin);
 | 
			
		||||
    xit('can send mail', sendMail);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user