-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'su37josephxia-timeline'
- Loading branch information
Showing
8 changed files
with
76 additions
and
6 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
File renamed without changes.
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 @@ | ||
import TimelineItem from '../TimelineItem.vue' | ||
import { mount } from '@vue/test-utils' | ||
describe('TimelineItem.vue', () => { | ||
it('should timeline works', () => { | ||
const wrapper = mount(TimelineItem, { | ||
props: { | ||
timestamp: '2018-04-15' | ||
}, | ||
slots: { | ||
default: '吃饭饭' | ||
} | ||
}) | ||
|
||
expect(wrapper.find('.el-timeline-item__timestamp').text()).toBe( | ||
'2018-04-15' | ||
) | ||
expect(wrapper.find('.el-timeline-item__content').text()).toBe('吃饭饭') | ||
}) | ||
}) |
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,38 @@ | ||
import Timeline from '../Timeline.vue' | ||
import { mount } from '@vue/test-utils' | ||
describe('Timeline.vue', () => { | ||
it('should slot works', () => { | ||
const wrapper = mount(Timeline, { | ||
slots: { | ||
default: [`A`, `B`] | ||
} | ||
}) | ||
expect(wrapper.find('.el-timeline').text()).toBe('AB') | ||
}) | ||
|
||
it('should props reverse works', () => { | ||
const wrapper = mount(Timeline, { | ||
props: { | ||
reverse: true | ||
}, | ||
slots: { | ||
default: [`A`, `B`] | ||
} | ||
}) | ||
expect(wrapper.find('.el-timeline').text()).toBe('BA') | ||
}) | ||
|
||
it('should slot null', () => { | ||
const wrapper = mount(Timeline, {}) | ||
expect(wrapper.find('.el-timeline').text()).toBe('') | ||
}) | ||
|
||
it('should slot empty array', () => { | ||
const wrapper = mount(Timeline, { | ||
slots: { | ||
default: [] | ||
} | ||
}) | ||
expect(wrapper.find('.el-timeline').text()).toBe('') | ||
}) | ||
}) |
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
8d2a0aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: