Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dauriamarco committed Mar 15, 2024
1 parent 15ffc76 commit 5e2efce
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 50 deletions.
91 changes: 41 additions & 50 deletions src/components/stepper/stepper/__snapshots__/stepper.spec.snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ snapshots["sbb-stepper renders"] =
`;
/* end snapshot sbb-stepper renders */

snapshots["sbb-tab-group A11y tree Chrome"] =
snapshots["sbb-stepper A11y tree Chrome"] =
`<p>
{
"role": "WebArea",
Expand All @@ -35,113 +35,104 @@ snapshots["sbb-tab-group A11y tree Chrome"] =
},
{
"role": "tab",
"name": "Test step label 3"
"name": "Test step label 3",
"disabled": true
},
{
"role": "tab",
"name": "Test step label 4"
},
{
"role": "tabpanel",
"name": "",
"children": [
{
"role": "text",
"name": "Test step content 1"
}
]
"role": "text",
"name": "Test step content 1"
}
]
}
</p>
`;
/* end snapshot sbb-tab-group A11y tree Chrome */
/* end snapshot sbb-stepper A11y tree Chrome */

snapshots["sbb-tab-group A11y tree Firefox"] =
snapshots["sbb-stepper A11y tree Firefox"] =
`<p>
{
"role": "document",
"name": "",
"children": [
{
"role": "tab",
"name": "Test step label 1",
"name": "1 Test step label 1",
"selected": true
},
{
"role": "tab",
"name": "Test step label 2"
"name": "2 Test step label 2"
},
{
"role": "tab",
"name": "Test step label 3"
"name": "3 Test step label 3",
"disabled": true
},
{
"role": "tab",
"name": "Test step label 4"
"name": "4 Test step label 4"
},
{
"role": "text leaf",
"name": "Test step content 1"
},
{
"role": "tabpanel",
"name": "",
"children": [
{
"role": "text leaf",
"name": "Test step content 1"
}
]
"name": "2 Test step label 2"
},
{
"role": "tabpanel",
"name": "3 Test step label 3"
}
]
}
</p>
`;
/* end snapshot sbb-tab-group A11y tree Firefox */
/* end snapshot sbb-stepper A11y tree Firefox */

snapshots["sbb-tab-group A11y tree Safari"] =
snapshots["sbb-stepper A11y tree Safari"] =
`<p>
{
"role": "WebArea",
"name": "",
"children": [
{
"role": "tab",
"name": "Test step label 1",
"selected": true
"role": "tabpanel",
"name": "3 Test step label 3"
},
{
"role": "tabpanel",
"name": "2 Test step label 2"
},
{
"role": "text",
"name": "Test step content 1"
},
{
"role": "tab",
"name": "Test step label 2"
"name": "1 Test step label 1",
"selected": true
},
{
"role": "tab",
"name": "Test step label 3"
"name": "2 Test step label 2"
},
{
"role": "tab",
"name": "Test step label 4"
"name": "3 Test step label 3",
"disabled": true
},
{
"role": "tabpanel",
"name": "",
"children": [
{
"role": "text",
"name": "Test step content 1"
}
]
"role": "tab",
"name": "4 Test step label 4"
}
]
}
</p>
`;
/* end snapshot sbb-tab-group A11y tree Safari */

snapshots["sbb-stepper A11y tree Chrome"] =
`<p>
{
"role": "WebArea",
"name": ""
}
</p>
`;
/* end snapshot sbb-stepper A11y tree Chrome */
/* end snapshot sbb-stepper A11y tree Safari */

16 changes: 16 additions & 0 deletions src/components/stepper/stepper/stepper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,24 @@ import { html } from 'lit/static-html.js';

import { testA11yTreeSnapshot } from '../../core/testing/a11y-tree-snapshot';
import '.';
import '../step';
import '../step-label';

describe('sbb-stepper', () => {
beforeEach(async () => {
await fixture(html`
<sbb-stepper selected-index="0">
<sbb-step-label>Test step label 1</sbb-step-label>
<sbb-step>Test step content 1</sbb-step>
<sbb-step-label>Test step label 2</sbb-step-label>
<sbb-step>Test step content 2</sbb-step>
<sbb-step-label disabled>Test step label 3</sbb-step-label>
<sbb-step>Test step content 3</sbb-step>
<sbb-step-label>Test step label 4</sbb-step-label>
</sbb-stepper>
`);
});

it('renders', async () => {
const root = await fixture(html`<sbb-stepper></sbb-stepper>`);
expect(root).dom.to.be.equal(`<sbb-stepper orientation="horizontal"></sbb-stepper>`);
Expand Down

0 comments on commit 5e2efce

Please sign in to comment.