space-storage.test.js 666 字节
Newer Older
A
Anne_LXM 已提交
1
jest.setTimeout(20000)
A
Anne_LXM 已提交
2 3 4 5 6 7 8 9 10 11
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', {
A
Anne_LXM 已提交
12
			filePath: '/static/logo.png',
A
Anne_LXM 已提交
13 14 15 16 17 18 19
			cloudPath: Date.now() + 'test.png'
		})
		console.log('res: ', res);
		expect(res.success).toBeTruthy()
		expect(res.fileID).toEqual(expect.stringContaining('https'));  
	})
})