Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Voeg end 2 end test toe om regressies te vermijden (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderKleykens committed Apr 23, 2021
1 parent d9f1846 commit 5579009
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
15 changes: 13 additions & 2 deletions demo/vl-select.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@
<option value="Gent">Gent</option>
</optgroup>
</select>

<div>
Je hebt gezocht naar: <span id="search-value">/</span>
</div>

<script type="text/javascript">
const element = document.getElementById('select-searchable');
element.addEventListener('changeQuery', ({detail: {value}}) => {
const searchValueElement = document.getElementById('search-value');
searchValueElement.textContent = value;
});
</script>
</vl-demo>

<vl-demo data-vl-title="Select zonder search">
Expand Down Expand Up @@ -228,7 +240,6 @@
<div is="vl-action-group" slot="actions">
<button id="dress-button" is="vl-button" onclick="document.getElementById('select-dress-undress-methode').dress()" type="button">Dress</button>
<button id="undress-button" is="vl-button" onclick="document.getElementById('select-dress-undress-methode').undress()" type="button">Undress</button>
</div>
</div>
</vl-demo>

Expand Down Expand Up @@ -305,4 +316,4 @@
</vl-demo-page>
</body>

</html>
</html>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
"vl-ui-form-grid": "^3.0.8",
"vl-ui-modal": "^4.0.3",
"vl-ui-upload": "^3.4.0",
"vl-ui-util": "^5.3.7"
"vl-ui-util": "^5.3.11"
}
}
2 changes: 1 addition & 1 deletion src/style.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions test/e2e/pages/vl-select.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ class VlSelectPage extends Page {
return this._getSelect('#select-set-get-methode');
}

async getSearchValue() {
return (await this.driver.findElement(By.css('#search-value'))).getText();
}

async activeerDynamischeData() {
return (await this.driver.findElement(By.css('#activate-data-button'))).click();
}
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/select.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,10 @@ describe('vl-select', async () => {
await vlSelectPage.remove();
await assert.eventually.isEmpty(select.getSelectedValue());
});

it('als gebruiker kan ik een terugkoppeling te zien krijgen als ik zoek', async () => {
const select = await vlSelectPage.getSearchableSelect();
await select.search('foobar');
await assert.eventually.equal(vlSelectPage.getSearchValue(), 'foobar');
});
});

0 comments on commit 5579009

Please sign in to comment.