Skip to content

Commit

Permalink
fix: Remove assertions that test implementation details
Browse files Browse the repository at this point in the history
These assertions prevent the migration of SafeAnchor to a
functional component, as they are testing implementation details.
  • Loading branch information
bpas247 committed Jul 28, 2019
1 parent fc41617 commit 44d5e28
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
7 changes: 0 additions & 7 deletions test/DropdownItemSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ describe('<Dropdown.Item>', () => {
.should.not.have.property('onSelect');
});

it('does not pass onSelect to children', () => {
mount(<Dropdown.Item onSelect={() => {}}>Item</Dropdown.Item>)
.find('SafeAnchor')
.props()
.should.not.have.property('onSelect');
});

it('disabled link', () => {
const handleSelect = () => {
throw new Error('Should not invoke onSelect event');
Expand Down
4 changes: 0 additions & 4 deletions test/SafeAnchorSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,14 @@ describe('SafeAnchor', () => {

it('Should disable link behavior', () => {
let clickSpy = sinon.spy();
let spy = sinon.spy(SafeAnchor.prototype, 'handleClick');

mount(
<SafeAnchor disabled href="#foo" onClick={clickSpy}>
Title
</SafeAnchor>,
).simulate('click');

expect(spy).to.have.been.calledOnce;
expect(clickSpy).to.have.not.been.called;
expect(spy.getCall(0).args[0].isDefaultPrevented()).to.equal(true);
expect(spy.getCall(0).args[0].isPropagationStopped()).to.equal(true);
});

it('forwards provided role', () => {
Expand Down

0 comments on commit 44d5e28

Please sign in to comment.