-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ use the correct date format string (CR) - SUITEDEV-27058
- Loading branch information
Showing
6 changed files
with
71 additions
and
35 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/renderer/components/backup-selector/backup-list-item/backup-list-item.html
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,20 @@ | ||
<div | ||
class="e-actionlist__item" | ||
:class="{ | ||
'e-actionlist__item-selected': selected, | ||
'e-actionlist__item-active': hovered | ||
}" | ||
@mouseenter="mouseEnter()" | ||
@mouseleave="mouseLeave()" | ||
@click="$emit('click')" | ||
> | ||
<e-icon v-if="selected" icon="check" class="e-actionlist__selected_marker"> | ||
</e-icon> | ||
{{ time }} | ||
<div | ||
@click.stop="$emit('view')" | ||
class="e-btn e-btn-small e-btn-onlyicon e-margin-left-m" | ||
> | ||
<e-icon icon="eye"></e-icon> | ||
</div> | ||
</div> |
19 changes: 19 additions & 0 deletions
19
src/renderer/components/backup-selector/backup-list-item/backup-list-item.js
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 @@ | ||
export default { | ||
name: 'backup-list-item', | ||
template: require('./backup-list-item.html'), | ||
props: { | ||
selected: Boolean, | ||
time: String | ||
}, | ||
data: () => ({ | ||
hovered: false | ||
}), | ||
methods: { | ||
mouseEnter() { | ||
this.hovered = true; | ||
}, | ||
mouseLeave() { | ||
this.hovered = false; | ||
} | ||
} | ||
}; |
19 changes: 19 additions & 0 deletions
19
src/renderer/components/backup-selector/backup-list-item/backup-list-item.spec.js
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 { mount } from '@vue/test-utils'; | ||
import BackupListItem from './backup-list-item'; | ||
|
||
describe('BackupListItem', () => { | ||
const isHovered = wrapper => wrapper.classes('e-actionlist__item-active'); | ||
|
||
it('should listen to mouse enter/leave events and update hover state accordingly', async () => { | ||
const wrapper = mount(BackupListItem); | ||
expect(isHovered(wrapper)).to.be.false; | ||
|
||
wrapper.trigger('mouseenter'); | ||
await wrapper.vm.$nextTick(); | ||
expect(isHovered(wrapper)).to.be.true; | ||
|
||
wrapper.trigger('mouseleave'); | ||
await wrapper.vm.$nextTick(); | ||
expect(isHovered(wrapper)).to.be.false; | ||
}); | ||
}); |
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
20 changes: 6 additions & 14 deletions
20
src/renderer/components/backup-selector/backup-selector.js
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