-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: update config * test(calendar): resove timezone problem * test(calendar): resove timezone problem * test(calendar): resove timezone problem * test(input): update snapshot
- Loading branch information
Showing
105 changed files
with
482 additions
and
410 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = async () => { | ||
process.env.TZ = 'Asia/Shanghai'; | ||
}; |
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,2 +1,14 @@ | ||
import Path from 'path'; | ||
import simulate from 'miniprogram-simulate'; | ||
|
||
global.getApp = () => null; | ||
global.Page = (options) => Component(options); | ||
global.load = (path, demoName) => { | ||
return simulate.load(path, demoName, { | ||
less: true, | ||
rootPath: Path.resolve(__dirname, '../../src'), | ||
compilerOptions: { | ||
maxBuffer: 1024 * (1024 + 100), | ||
}, | ||
}); | ||
}; |
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
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
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
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,80 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Calendar Calendar base demo works fine 1`] = ` | ||
<base> | ||
<t-calendar | ||
visible="{{false}}" | ||
bind:confirm="handleConfirm" | ||
/> | ||
<t-cell | ||
arrow="{{true}}" | ||
title="单个选择日历" | ||
bind:tap="handleCalendar" | ||
/> | ||
</base> | ||
`; | ||
|
||
exports[`Calendar Calendar custom-range demo works fine 1`] = ` | ||
<custom-range> | ||
<t-calendar | ||
maxDate="{{1645891200000}}" | ||
minDate="{{1643644800000}}" | ||
value="{{1644854400000}}" | ||
visible="{{false}}" | ||
bind:confirm="handleConfirm" | ||
/> | ||
<t-cell | ||
arrow="{{true}}" | ||
title="自定义区间" | ||
bind:tap="handleCalendar" | ||
/> | ||
</custom-range> | ||
`; | ||
|
||
exports[`Calendar Calendar custom-text demo works fine 1`] = ` | ||
<custom-text> | ||
<t-calendar | ||
format="{{[Function]}}" | ||
maxDate="{{1647273600000}}" | ||
minDate="{{1643644800000}}" | ||
value="{{1644854400000}}" | ||
visible="{{false}}" | ||
bind:confirm="handleConfirm" | ||
/> | ||
<t-cell | ||
arrow="{{true}}" | ||
title="自定义文案" | ||
bind:tap="handleCalendar" | ||
/> | ||
</custom-text> | ||
`; | ||
|
||
exports[`Calendar Calendar multiple demo works fine 1`] = ` | ||
<multiple> | ||
<t-calendar | ||
type="multiple" | ||
visible="{{false}}" | ||
bind:confirm="handleConfirm" | ||
/> | ||
<t-cell | ||
arrow="{{true}}" | ||
title="多个选择日历" | ||
bind:tap="handleCalendar" | ||
/> | ||
</multiple> | ||
`; | ||
|
||
exports[`Calendar Calendar range demo works fine 1`] = ` | ||
<range> | ||
<t-calendar | ||
type="range" | ||
visible="{{false}}" | ||
bind:confirm="handleConfirm" | ||
/> | ||
<t-cell | ||
arrow="{{true}}" | ||
title="区间选择日历" | ||
bind:tap="handleCalendar" | ||
/> | ||
</range> | ||
`; |
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,19 @@ | ||
/** | ||
* 该文件为由脚本 `npm run test:demo` 自动生成,如需修改,执行脚本命令即可。请勿手写直接修改,否则会被覆盖 | ||
*/ | ||
|
||
import simulate from 'miniprogram-simulate'; | ||
import path from 'path'; | ||
|
||
const mapper = ['base', 'custom-range', 'custom-text', 'multiple', 'range']; | ||
|
||
describe('Calendar', () => { | ||
mapper.forEach((demoName) => { | ||
it(`Calendar ${demoName} demo works fine`, () => { | ||
const id = load(path.resolve(__dirname, `../../calendar/_example/${demoName}/index`), demoName); | ||
const container = simulate.render(id); | ||
container.attach(document.createElement('parent-wrapper')); | ||
expect(container.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); | ||
}); |
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
Oops, something went wrong.