space-storage.test.js 648 字节
Newer Older
A
Anne_LXM 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
describe('pages/storage/space-storage.vue', () => {
	let page
	beforeAll(async () => {
		// 重新reLaunch至首页,并获取首页page对象(其中 program 是uni-automator自动注入的全局对象)
		page = await program.navigateTo('/pages/storage/space-storage')
		await page.waitFor('view')
	})
	it('space-storage-上传文件', async () => {
		expect.assertions(2);
		const res = await page.callMethod('uploadFile', {
			filePath: '../../static/logo.png',
			cloudPath: Date.now() + 'test.png'
		})
		console.log('res: ', res);
		expect(res.success).toBeTruthy()
		expect(res.fileID).toEqual(expect.stringContaining('https'));  
	})
})