Skip to content

Commit

Permalink
[Tests] Add spec for changing completed value
Browse files Browse the repository at this point in the history
  • Loading branch information
lsanwick committed Sep 23, 2020
1 parent 9131b4a commit 773a11f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/spec.js
Expand Up @@ -77,5 +77,17 @@ describe(`Progress`, () => {
);
});
});
it(`adjusts completeness after being mounted`, () => {
const sampleId = `#progressbar-changing`;
const waitForSample = createWaitForElement(sampleId);
const wrapper = mount(<Progress completed={25} />);
waitForSample(wrapper, DEFAULT_ANIMATION).then(component =>
expect(component.find('.progressbar-progress').get(0).style.width).toEqual(`25%`)
);
wrapper.setProps({ completed: 75 });
waitForSample(wrapper, DEFAULT_ANIMATION).then(component =>
expect(component.find('.progressbar-progress').get(0).style.width).toEqual(`75%`)
);
});
});
});

0 comments on commit 773a11f

Please sign in to comment.