From 241a071a3edeba6c8db212b86c1490afe2c0f6c1 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Wed, 25 Jul 2018 17:38:49 +0100 Subject: [PATCH] test: add postcss custom feature test case --- test/e2e/basic.browser.test.js | 8 +++++++- test/fixtures/basic/nuxt.config.js | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/test/e2e/basic.browser.test.js b/test/e2e/basic.browser.test.js index 9ffea9a6f9..782bd94465 100644 --- a/test/e2e/basic.browser.test.js +++ b/test/e2e/basic.browser.test.js @@ -40,7 +40,13 @@ describe('basic browser', () => { await page.nuxt.navigate('/css') expect(await page.$text('.red')).toBe('This is red') - expect(await page.$eval('.red', red => window.getComputedStyle(red).color)).toBe('rgb(255, 0, 0)') + expect(await page.$eval('.red', red => { + const { color, backgroundColor } = window.getComputedStyle(red) + return { color, backgroundColor } + })).toEqual({ + color: 'rgb(255, 0, 0)', + backgroundColor: 'rgb(0, 0, 255)' + }) }) test.skip('/stateful', async () => { diff --git a/test/fixtures/basic/nuxt.config.js b/test/fixtures/basic/nuxt.config.js index 3cc0c57e0c..65abaddd64 100644 --- a/test/fixtures/basic/nuxt.config.js +++ b/test/fixtures/basic/nuxt.config.js @@ -36,7 +36,11 @@ export default { build: { scopeHoisting: true, postcss: [ - require('postcss-preset-env')() + require('postcss-preset-env')({ + features: { + 'custom-selectors': true + } + }) ] } }