Skip to content

Commit

Permalink
test: fix failing select tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanjones243 authored and jason-capsule42 committed Jan 17, 2025
1 parent 837c6cf commit d17e1e0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions components/select/test/auro-select.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('auro-select', () => {
await expect(el.optionSelected).to.be.equal(selectedOptions[0]);
});

it('make invalid selection programmatically results in error ui', async () => {
it('making invalid selection programmatically results in resetting of component', async () => {
const el = await presetValueFixture();

await expect(el.value).to.be.equal('price');
Expand All @@ -111,12 +111,8 @@ describe('auro-select', () => {

await elementUpdated(el);

const dropdown = el.shadowRoot.querySelector('[auro-dropdown]');
const triggerContentHTML = dropdown.querySelector('#triggerFocus').innerHTML;

await expect(el.optionSelected).to.be.equal(undefined);
await expect(triggerContentHTML).to.contain(el.placeholder);
await expect(el.getAttribute('validity')).to.equal(undefined);
await expect(el.hasAttribute('validity')).to.be.false;
});

it('reset selection value programmatically', async () => {
Expand Down Expand Up @@ -159,7 +155,8 @@ describe('auro-select', () => {

it('reset method clears the value and validity state', async () => {
const el = await presetValueFixture();
const presetOption = el.shadowRoot.querySelector('#presetOption');
const dropdown = el.shadowRoot.querySelector('[auro-dropdown]');
const presetOption = dropdown.bibContent.querySelector('#presetOption');

await expect(el.value).to.be.equal('price');
await expect(el.optionSelected).to.be.equal(presetOption);
Expand Down

0 comments on commit d17e1e0

Please sign in to comment.