diff --git a/pages/API/create-canvas-context-async/child-canvas.uvue b/pages/API/create-canvas-context-async/child-canvas.uvue index 3b76215d7c7b6b02ec0ebdf48a9866a2f1eff6f3..408d89a7737be3db75153201c5a90821beed3eab 100644 --- a/pages/API/create-canvas-context-async/child-canvas.uvue +++ b/pages/API/create-canvas-context-async/child-canvas.uvue @@ -1,44 +1,41 @@ + \ No newline at end of file diff --git a/pages/API/create-canvas-context-async/create-canvas-context-async.test.js b/pages/API/create-canvas-context-async/create-canvas-context-async.test.js index 7eef070df8d1d15038a8fdaf0f8b7d86cdf8428c..8b06db93239e4e0b0726cda3bd453a0589921916 100644 --- a/pages/API/create-canvas-context-async/create-canvas-context-async.test.js +++ b/pages/API/create-canvas-context-async/create-canvas-context-async.test.js @@ -1,32 +1,25 @@ const PAGE_PATH = '/pages/API/create-canvas-context-async/create-canvas-context-async' describe('create-canvas-context-async', () => { - if (!process.env.uniTestPlatformInfo.toLowerCase().startsWith('ios')) { - it('ios only', () => { - expect(1).toBe(1) - }) - return - } - let page - beforeAll(async () => { - page = await program.reLaunch(PAGE_PATH) - await page.waitFor('view') - }) + let page + beforeAll(async () => { + page = await program.reLaunch(PAGE_PATH) + await page.waitFor('view') + }) - it('page canvas', async () => { - await page.waitFor(100) - const data = await page.callMethod('getContext') - expect(data.ctx).toBe('object') - expect(data.hasFillRect).toBe(true) - }) + it('page canvas', async () => { + await page.waitFor(100) + const data = await page.data() + expect(data.isCanvasContextNull).toBe(true) + }) - it('component canvas', async () => { - // child-canvas - await page.waitFor(100) - // const element = await page.$('.node-child-component') - const element = await page.$('child-canvas') - const data = await page.callMethod('getContext') - expect(data.ctx).toBe('object') - expect(data.hasFillRect).toBe(true) - }) -}) + it('component canvas', async () => { + // child-canvas + await page.waitFor(100) + // const element = await page.$('.node-child-component') + const element = await page.$('child-canvas') + const data = await page.data() + expect(data.isCanvasContextNull).toBe(true) + + }) +}) \ No newline at end of file diff --git a/pages/API/create-canvas-context-async/create-canvas-context-async.uvue b/pages/API/create-canvas-context-async/create-canvas-context-async.uvue index 9805decfae6ab2d7c7101fb65aebf786ba48b749..27f3aa3b44c822d33e4a78e4089e445ea1ffb5ae 100644 --- a/pages/API/create-canvas-context-async/create-canvas-context-async.uvue +++ b/pages/API/create-canvas-context-async/create-canvas-context-async.uvue @@ -2,48 +2,45 @@ create canvas context async - + isCanvasContextNull: {{isCanvasContextNull}} + \ No newline at end of file