Skip to content

Commit

Permalink
test(progress-bar): add lower bound test
Browse files Browse the repository at this point in the history
  • Loading branch information
rouven-s committed Jun 14, 2024
1 parent 439ef6a commit 7d50dbf
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,23 @@ describe('ix-progress-bar', () => {
);
});

it('has correct values with invalid inputs', async () => {
it('has correct values with lower bound inputs', async () => {
await newSpecPage({
components: [ProgressBar],
html: '<ix-progress-bar value="-20"></ix-progress-bar>',
});

const progressBar = document.querySelector('ix-progress-bar');
const progressBarDiv = progressBar.shadowRoot.querySelector(
'.progress'
) as HTMLElement;
expect(progressBarDiv.style.width).toBe('0%');
expect(progressBarDiv.style.backgroundColor).toBe(
'var(--theme-color-primary)'
);
});

it('has correct values with upper bound inputs', async () => {
await newSpecPage({
components: [ProgressBar],
html: '<ix-progress-bar value="120" variant="critical"></ix-progress-bar>',
Expand Down

0 comments on commit 7d50dbf

Please sign in to comment.