Skip to content

Commit

Permalink
Define items in visual test for vaadin-message-list with js (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peppe committed Feb 12, 2021
1 parent bcd7021 commit c5be790
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions test/visual/message-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@

<body>
<div id="tests" style="padding: 10px">
<vaadin-message-list
items='[{"text":"Hello list","time":"yesterday","userName":"Matt Mambo","userAbbr":"MM",
"userColorIndex":1},{"text":"Another message","time":"right now","userName":"Linsey Listy",
"userAbbr":"LL","userColorIndex":2,"userImg":"/test/visual/avatars/avatar.jpg"}]'>
</vaadin-message-list>
<vaadin-message-list></vaadin-message-list>
</div>

<script type="module">
Expand All @@ -30,6 +26,24 @@
await import('../../theme/' + theme + '/vaadin-message-list.js');

window.requestAnimationFrame(() => {
const messageList = document.querySelector('vaadin-message-list');
messageList.items = [
{
text: 'Hello list',
time: 'yesterday',
userName: 'Matt Mambo',
userAbbr: 'MM',
userColorIndex: 1
},
{
text: 'Another message',
time: 'right now',
userName: 'Linsey Listy',
userAbbr: 'LL',
userColorIndex: 2,
userImg: '/test/visual/avatars/avatar.jpg'
}
];
document.getElementById('tests').dataset.ready = true;
});
})();
Expand Down

0 comments on commit c5be790

Please sign in to comment.