forked from vueComponent/pro-components
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
81 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
const rimraf = require('rimraf'); | ||
const path = require('path'); | ||
import rimraf from 'rimraf'; | ||
import path from 'path'; | ||
|
||
const errorHandler = (err) => { | ||
console.error('err', err); | ||
} | ||
const errorHandler = err => { | ||
if (err !== null) { | ||
console.warn(err); | ||
} | ||
}; | ||
|
||
rimraf(path.resolve(__dirname, 'es'), errorHandler); | ||
rimraf(path.resolve(__dirname, 'lib'), errorHandler); | ||
rimraf(path.resolve(__dirname, '../es'), errorHandler); | ||
rimraf(path.resolve(__dirname, '../lib'), errorHandler); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,6 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowSyntheticDefaultImports": true, | ||
"declaration": true, | ||
"module": "esnext", | ||
"target": "esnext", | ||
"moduleResolution": "node", | ||
"jsx": "preserve", | ||
"module": "commonJS", | ||
"esModuleInterop": true | ||
}, | ||
"include": ["./src", "./typings/"], | ||
"typings": "./typings/index.d.ts", | ||
"exclude": [ | ||
"node_modules", | ||
"build", | ||
"scripts", | ||
"acceptance-tests", | ||
"webpack", | ||
"jest", | ||
"src/setupTests.ts", | ||
"tslint:latest", | ||
"tslint-config-prettier" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`GridContent shoul render with empty children 1`] = ` | ||
<div class="ant-pro-grid-content"> | ||
<div class="ant-pro-grid-content-children"> | ||
<!----> | ||
</div> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { mount } from '@vue/test-utils'; | ||
import GridContent from '../src/GridContent'; | ||
|
||
describe('GridContent', () => { | ||
|
||
it('shoul render with empty children', () => { | ||
const wrapper = mount(GridContent, { }); | ||
expect(wrapper.html()).toMatchSnapshot(); | ||
}); | ||
|
||
it('shoul render with prop Fixed', () => { | ||
const wrapper = mount({ | ||
setup() { | ||
return () => ( | ||
<GridContent contentWidth="Fixed"></GridContent> | ||
); | ||
}, | ||
}); | ||
expect(wrapper.classes().indexOf('wide') > -1).toBe(true); | ||
}); | ||
|
||
it('shoul render with children', () => { | ||
const wrapper = mount({ | ||
setup() { | ||
return () => ( | ||
<GridContent contentWidth="Fixed"> | ||
<div>children</div> | ||
</GridContent> | ||
); | ||
}, | ||
}); | ||
expect(wrapper.find('.ant-pro-grid-content-children').element.innerHTML === '<div>children</div>').toBe(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import { mount } from '@vue/test-utils'; | ||
// import BasicLayout from '../src/BasicLayout'; | ||
|
||
describe('index', () => { | ||
describe('BasicLayout', () => { | ||
|
||
it('shoul render GridContent', () => { | ||
// empty | ||
it('🥩 base use', () => { | ||
// const wrapper = mount(BasicLayout, { }); | ||
// console.log(wrapper.html()); | ||
// expect(wrapper.html()).toMatchSnapshot(); | ||
}); | ||
|
||
}); |