diff --git a/.all-contributorsrc b/.all-contributorsrc index 28438d8dd..e452a13fa 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -655,6 +655,16 @@ "contributions": [ "doc" ] + }, + { + "login": "ZahraTee", + "name": "Zahra Traboulsi", + "avatar_url": "https://avatars0.githubusercontent.com/u/5565340?v=4", + "profile": "http://www.zahra.tech", + "contributions": [ + "code", + "test" + ] } ] } diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index e9e1b75d1..c0d425377 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -15,5 +15,5 @@ Thank you to all the people who have already contributed to GitPoint! | [
Peter Blazejewicz](http://www.linkedin.com/in/peterblazejewicz)
[🌍](#translation-peterblazejewicz "Translation") | [
Eric Adamski](https://github.com/ericadamski)
[πŸ›](https://github.com/gitpoint/git-point/issues?q=author%3Aericadamski "Bug reports") | [
Jouderian Nobre Junior](https://github.com/jouderianjr)
[πŸ’»](https://github.com/gitpoint/git-point/commits?author=jouderianjr "Code") | [
Phi Dong](http://www.phidong.com)
[πŸ’»](https://github.com/gitpoint/git-point/commits?author=pdong "Code") | [
John Patrick Salcedo](https://github.com/jpls93)
[πŸ’»](https://github.com/gitpoint/git-point/commits?author=jpls93 "Code") | [
Γ“scar Carretero](https://github.com/ocarreterom)
[πŸ’»](https://github.com/gitpoint/git-point/commits?author=ocarreterom "Code") | | [
Dyesse YUMBA](https://github.com/dyesseyumba)
[πŸ”§](#tool-dyesseyumba "Tools") | [
Bink](https://binkpitch.me/)
[πŸ’»](https://github.com/gitpoint/git-point/commits?author=binkpitch "Code") | [
khvilaboa](https://github.com/khvilaboa)
[🌍](#translation-khvilaboa "Translation") | [
James Glover](http://jamesmglover.com)
[πŸ’»](https://github.com/gitpoint/git-point/commits?author=jglover "Code") [⚠️](https://github.com/gitpoint/git-point/commits?author=jglover "Tests") | [
Jose Luis Naranjo](https://co.linkedin.com/in/josenaranjo/en)
[πŸ’»](https://github.com/gitpoint/git-point/commits?author=josenaranjo "Code") | [
Tobias Lohse](http://MrLoh.se)
[πŸ’»](https://github.com/gitpoint/git-point/commits?author=MrLoh "Code") | | [
Serhii Baraniuk](https://www.facebook.com/serhii.baraniuk)
[⚠️](https://github.com/gitpoint/git-point/commits?author=kenitive "Tests") | [
Ben Snider](http://www.bensnider.com/)
[⚠️](https://github.com/gitpoint/git-point/commits?author=stupergenius "Tests") | [
Simon Hoyos](https://www.linkedin.com/in/simonhoyos/)
[πŸ’»](https://github.com/gitpoint/git-point/commits?author=shmesa22 "Code") [🎨](#design-shmesa22 "Design") | [
Damien Leroy](https://github.com/ShiiFu)
[🌍](#translation-ShiiFu "Translation") | [
botbotbot](http://dev.im-bot.com)
[⚠️](https://github.com/gitpoint/git-point/commits?author=ibotdotout "Tests") | [
Dmytro Kytsmen](https://github.com/Kietzmann)
[🌍](#translation-Kietzmann "Translation") | -| [
TheCodeTalker](https://thecodetalker.github.io/)
[πŸ’»](https://github.com/gitpoint/git-point/commits?author=TheCodeTalker "Code") | [
Leonardo](https://github.com/LeoCp)
[πŸ’»](https://github.com/gitpoint/git-point/commits?author=LeoCp "Code") | [
Stephen](https://github.com/coderste)
[πŸ“–](https://github.com/gitpoint/git-point/commits?author=coderste "Documentation") | +| [
TheCodeTalker](https://thecodetalker.github.io/)
[πŸ’»](https://github.com/gitpoint/git-point/commits?author=TheCodeTalker "Code") | [
Leonardo](https://github.com/LeoCp)
[πŸ’»](https://github.com/gitpoint/git-point/commits?author=LeoCp "Code") | [
Stephen](https://github.com/coderste)
[πŸ“–](https://github.com/gitpoint/git-point/commits?author=coderste "Documentation") | [
Zahra Traboulsi](http://www.zahra.tech)
[πŸ’»](https://github.com/gitpoint/git-point/commits?author=ZahraTee "Code") [⚠️](https://github.com/gitpoint/git-point/commits?author=ZahraTee "Tests") | diff --git a/README.md b/README.md index b7de402d1..ae46bd66c 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ [![Build Status](https://img.shields.io/travis/gitpoint/git-point.svg?style=flat-square)](https://travis-ci.org/gitpoint/git-point) [![Coveralls](https://img.shields.io/coveralls/github/gitpoint/git-point.svg?style=flat-square)](https://coveralls.io/github/gitpoint/git-point) -[![All Contributors](https://img.shields.io/badge/all_contributors-69-orange.svg?style=flat-square)](#contributors) +[![All Contributors](https://img.shields.io/badge/all_contributors-70-orange.svg?style=flat-square)](#contributors) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli/) [![Gitter chat](https://img.shields.io/badge/chat-on_gitter-008080.svg?style=flat-square)](https://gitter.im/git-point) diff --git a/__tests__/tests/components/NotificationIcon.js b/__tests__/tests/components/NotificationIcon.js new file mode 100644 index 000000000..0552be086 --- /dev/null +++ b/__tests__/tests/components/NotificationIcon.js @@ -0,0 +1,47 @@ +import React from 'react'; +import { shallow, render } from 'enzyme'; +import { Badge, NotificationIconComponent } from 'components'; + +const defaultProps = { + iconColor: 'red', + notificationsCount: 10, +}; + +describe('', () => { + it('should display a Badge component when notificationsCount is greater than 0', () => { + const wrapper = shallow(); + + const badges = wrapper.find(Badge); + expect(badges.length).toBe(1); + }); + + it('should not display a Badge component when notificationsCount is 0', () => { + const wrapper = shallow( + + ); + + const badges = wrapper.find(Badge); + expect(badges.length).toBe(0); + }); + + it("should display a Badge component displaying '99+' in normal text when notificationsCount is greater than 99", () => { + const wrapper = shallow( + + ); + + const badge = wrapper.find(Badge); + expect(badge.prop('text')).toBe('99+'); + expect(badge.prop('largeText')).toBe(false); + }); + + it('should display a Badge component displaying notificationsCount in largeText if notificationsCount is less than or equal to 99', () => { + const wrapper = shallow( + + ); + + const badge = wrapper.find(Badge); + + expect(badge.prop('text')).toBe(99); + expect(badge.prop('largeText')).toBe(true); + }); +}); diff --git a/__tests__/tests/components/RepositorySectionTitle.js b/__tests__/tests/components/RepositorySectionTitle.js new file mode 100644 index 000000000..09385ebdf --- /dev/null +++ b/__tests__/tests/components/RepositorySectionTitle.js @@ -0,0 +1,28 @@ +import React from 'react'; +import { shallow, render } from 'enzyme'; +import { RepositorySectionTitle, StateBadge } from 'components'; + +const defaultProps = { + text: 'test title', + openCount: 10, + closedCount: 10, + loading: false, +}; + +describe('', () => { + it('should display no StateBadge components if loading is true', () => { + const wrapper = shallow( + + ); + const badges = wrapper.find(StateBadge); + + expect(badges.length).toBe(0); + }); + + it('should display two StateBadge components if loading is false', () => { + const wrapper = shallow(); + const badges = wrapper.find(StateBadge); + + expect(badges.length).toBe(2); + }); +}); diff --git a/src/components/notification-icon.component.js b/src/components/notification-icon.component.js index 4f8a48639..13c2ba4e0 100644 --- a/src/components/notification-icon.component.js +++ b/src/components/notification-icon.component.js @@ -20,7 +20,7 @@ const mapStateToProps = state => ({ notificationsCount: state.notifications.notificationsCount, }); -class NotificationIconComponent extends Component { +export class NotificationIconComponent extends Component { props: { iconColor: string, notificationsCount: number,