Skip to content

Commit

Permalink
Merge 0d31264 into 6aacb6b
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan committed Jan 27, 2020
2 parents 6aacb6b + 0d31264 commit e2d1693
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 22 deletions.
43 changes: 43 additions & 0 deletions test/visual/dropdown-template.html
@@ -0,0 +1,43 @@
<!DOCTYPE html>

<head lang="en">
<meta charset="UTF-8">

<script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
<script>
const theme = window.location.search.replace(/.*theme=(\w+).*/, '$1') || 'lumo';
document.write(`<link rel="import" href="../../theme/${theme}/vaadin-combo-box.html">`);
</script>
<dom-module id="text-field-styles" theme-for="vaadin-text-field">
<template>
<style>
:host [part="value"] {
font-size: 0;
height: 24px;
}
</style>
</template>
</dom-module>
</head>

<body>

<div id="template-tests" style="padding: 10px; min-height: 300px;">
Item template
<vaadin-combo-box item-label-path="name" item-value-path="symbol">
<template>
<b>[[item.name]], <sub>[[item.number]]</sub>[[item.symbol]]</b><br>
array index: [[index]]
</template>
</vaadin-combo-box>
</div>

<script>
document.querySelector('vaadin-combo-box').items = [
{name: 'Hydrogen', symbol: 'H', number: 1},
{name: 'Helium', symbol: 'He', number: 2},
{name: 'Lithium', symbol: 'Li', number: 3}
];
</script>

</body>
21 changes: 3 additions & 18 deletions test/visual/dropdown.html
Expand Up @@ -23,31 +23,16 @@
<body>

<div id="dropdown-tests" style="padding: 10px; min-height: 300px;">
Plain template
<vaadin-combo-box id="plain" item-label-path="name" item-value-path="symbol"></vaadin-combo-box>

<br> Item template
<vaadin-combo-box id="template" item-label-path="name" item-value-path="symbol">
<template>
<b>[[item.name]], <sub>[[item.number]]</sub>[[item.symbol]]</b><br>
array index: [[index]]
</template>
</vaadin-combo-box>
Dropdown
<vaadin-combo-box item-label-path="name" item-value-path="symbol"></vaadin-combo-box>
</div>

<script>
var elementsJson = [
document.querySelector('vaadin-combo-box').items = [
{name: 'Hydrogen', symbol: 'H', number: 1},
{name: 'Helium', symbol: 'He', number: 2},
{name: 'Lithium', symbol: 'Li', number: 3}
];

var comboBoxes = document.querySelectorAll('vaadin-combo-box');

[].forEach.call(comboBoxes, function(combo) {
// do whatever
combo.items = elementsJson;
});
</script>

</body>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 10 additions & 4 deletions test/visual/test.js
Expand Up @@ -42,12 +42,18 @@ gemini.suite('vaadin-combo-box', function(rootSuite) {
.setCaptureElements('#dropdown-tests')
.capture('default', function(actions) {
actions.executeJS(function(window) {
window.document.querySelector('#plain').open();
window.document.querySelector('vaadin-combo-box').open();
});
})
.capture('template', function(actions) {
});
});

gemini.suite(`dropdown-template-${theme}`, function(suite) {
suite
.setUrl(`dropdown-template.html?theme=${theme}`)
.setCaptureElements('#template-tests')
.capture('default', function(actions) {
actions.executeJS(function(window) {
window.document.querySelector('#template').open();
window.document.querySelector('vaadin-combo-box').open();
});
});
});
Expand Down

0 comments on commit e2d1693

Please sign in to comment.