Skip to content

Commit ed72e81

Browse files
delete button hover styling applied
1 parent e59e1a9 commit ed72e81

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

src/todomvc/components/Footer.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ export default class Footer extends Component {
3131
cursor: 'pointer',
3232
WebkitAppearance: 'none',
3333
WebkitFontSmoothing: 'antialiased',
34-
MozOsxFontSmoothing: 'grayscale'
34+
MozOsxFontSmoothing: 'grayscale',
35+
':hover': {
36+
fontStyle: 'italic',
37+
fontWeight: 'bold',
38+
color: 'indianred'
39+
},
3540
}
3641
};
3742

tests/todomvc/components/Footer.spec.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,32 @@ describe('Footer component', () => {
158158
expect(button.find({style: {WebkitAppearance: 'none'}})).to.have.length(1);
159159
expect(button.find({style: {WebkitFontSmoothing: 'antialiased'}})).to.have.length(1);
160160
expect(button.find({style: {MozOsxFontSmoothing: 'grayscale'}})).to.have.length(1);
161+
});
162+
163+
it('Should have delete button hover styling applied in accordance with the design specs', () => {
164+
const todos = List([
165+
Map({id: uuid.v4(), description: 'todo 1', completed: false}),
166+
Map({id: uuid.v4(), description: 'todo 2', completed: true}),
167+
Map({id: uuid.v4(), description: 'todo 3', completed: false})
168+
]);
169+
const {component} = setup(todos);
170+
let button = component.find('button');
171+
172+
expect(button.find({style: {fontStyle: 'italic'}})).to.have.length(0);
173+
expect(button.find({style: {fontWeight: 'bold'}})).to.have.length(0);
174+
expect(button.find({style: {color: 'indianred'}})).to.have.length(0);
175+
176+
button.simulate('mouseenter');
177+
button = component.find('button');
178+
expect(button.find({style: {fontStyle: 'italic'}})).to.have.length(1);
179+
expect(button.find({style: {fontWeight: 'bold'}})).to.have.length(1);
180+
expect(button.find({style: {color: 'indianred'}})).to.have.length(1);
181+
182+
button.simulate('mouseleave');
183+
button = component.find('button');
184+
expect(button.find({style: {fontStyle: 'italic'}})).to.have.length(0);
185+
expect(button.find({style: {fontWeight: 'bold'}})).to.have.length(0);
186+
expect(button.find({style: {color: 'indianred'}})).to.have.length(0);
161187
})
162188
})
163189
});

0 commit comments

Comments
 (0)