diff --git a/.babelrc.js b/.babelrc.js index 96df80013f0ad6a1e734cfae1def7407e022e720..e89d220448ee10197b332c1b9a9849b3942815f7 100644 --- a/.babelrc.js +++ b/.babelrc.js @@ -1,12 +1,21 @@ +const path = require('path'); + module.exports = { plugins: [ [ 'babel-plugin-module-resolver', { alias: { - components: './src/components', + components: path.join(__dirname, './src/components'), }, }, ], + [ + 'import', + { + libraryName: 'antd', + style: true, // or 'css' + }, + ], ], -}; \ No newline at end of file +}; diff --git a/package.json b/package.json index 650e5e9211c29e13ae68bb8a55a8eca2472e3711..10970b445064770e9cf067c24d3e48d5d681a48b 100755 --- a/package.json +++ b/package.json @@ -23,8 +23,6 @@ "dependencies": { "@antv/data-set": "^0.8.0", "@babel/polyfill": "^7.0.0-beta.36", - "@types/react": "^16.3.8", - "@types/react-dom": "^16.0.5", "antd": "^3.4.3", "antd-theme-webpack-plugin": "^1.0.8", "babel-plugin-transform-decorators-legacy": "^1.3.4", @@ -53,6 +51,8 @@ "url-polyfill": "^1.0.10" }, "devDependencies": { + "@types/react": "^16.3.8", + "@types/react-dom": "^16.0.5", "babel-eslint": "^8.1.2", "babel-plugin-dva-hmr": "^0.4.1", "babel-plugin-import": "^1.6.7", @@ -84,7 +84,7 @@ "stylelint-config-standard": "^18.0.0" }, "optionalDependencies": { - "puppeteer": "^1.1.1" + "puppeteer": "^1.3.0" }, "lint-staged": { "**/*.{js,jsx,less}": [ diff --git a/src/e2e/home.e2e.js b/src/e2e/home.e2e.js index 1a5d95136f5a7cc0f8739415cae3f13bd4b6b573..05377e852424f2835a77d3e15fd8f4604463b3fb 100644 --- a/src/e2e/home.e2e.js +++ b/src/e2e/home.e2e.js @@ -4,7 +4,7 @@ describe('Homepage', () => { it('it should have logo text', async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); - await page.goto('http://localhost:8000'); + await page.goto('http://localhost:8000', { waitUntil: 'networkidle2' }); await page.waitForSelector('h1'); const text = await page.evaluate(() => document.body.innerHTML); expect(text).toContain('

Ant Design Pro

'); diff --git a/src/e2e/login.e2e.js b/src/e2e/login.e2e.js index 5211a3b49f1d6dca169429871283f89dfc512c92..6095b9e5be9520550c2a01e72de9713f36fd8c7e 100644 --- a/src/e2e/login.e2e.js +++ b/src/e2e/login.e2e.js @@ -10,7 +10,7 @@ describe('Login', () => { beforeEach(async () => { page = await browser.newPage(); - await page.goto('http://localhost:8000/#/user/login'); + await page.goto('http://localhost:8000/#/user/login', { waitUntil: 'networkidle2' }); await page.evaluate(() => window.localStorage.setItem('antd-pro-authority', 'guest')); }); diff --git a/src/routes/Result/Success.js b/src/routes/Result/Success.js index 9e20e2780a4117bd4a3cd018aa11cba340ebc499..c27567a8f5801f6f4f0a50983b9d42a3f2ba73c7 100644 --- a/src/routes/Result/Success.js +++ b/src/routes/Result/Success.js @@ -1,6 +1,6 @@ import React, { Fragment } from 'react'; import { Button, Row, Col, Icon, Steps, Card } from 'antd'; -import Result from 'components/Result'; +import Result from '../../components/Result'; import PageHeaderLayout from '../../layouts/PageHeaderLayout'; const { Step } = Steps;