This repository has been archived by the owner on Jun 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #418 from quran/master
Merge master into production
- Loading branch information
Showing
26 changed files
with
261 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { shallow } from 'enzyme'; | ||
|
||
import Title from './index'; | ||
import getSurahs from '../../../../tests/fixtures/getSurahs.js'; | ||
|
||
let wrapper; | ||
let surah = { | ||
"id": 1, | ||
"name": { | ||
"arabic": "الفاتحة", | ||
"simple": "Al-Fatihah", | ||
"complex": "Al-Fātiĥah", | ||
"english": "The Opener" | ||
} | ||
}; | ||
|
||
|
||
describe('<Title />', () => { | ||
|
||
it('should render', () => { | ||
wrapper = renderComponent(surah); | ||
expect(wrapper).to.be.ok; | ||
}); | ||
|
||
it('should not show previous surah if on the first surah', () => { | ||
wrapper = renderComponent(surah); | ||
|
||
const previous = wrapper.find('.previous-chapter').length; | ||
const next = wrapper.find('.next-chapter').length; | ||
|
||
expect(previous).to.equal(0); | ||
expect(next).to.equal(1); | ||
}); | ||
|
||
it('should not show next surah if on the last surah', () => { | ||
surah.id = 114; | ||
wrapper = renderComponent(surah); | ||
|
||
const previous = wrapper.find('.previous-chapter').length; | ||
const next = wrapper.find('.next-chapter').length; | ||
|
||
expect(previous).to.equal(1); | ||
expect(next).to.equal(0); | ||
}); | ||
|
||
it('should show both next and previous if surah is neither last or first', () => { | ||
surah.id = 14; | ||
wrapper = renderComponent(surah); | ||
|
||
const previous = wrapper.find('.previous-chapter').length; | ||
const next = wrapper.find('.next-chapter').length; | ||
|
||
expect(previous).to.equal(1); | ||
expect(next).to.equal(1); | ||
}); | ||
}); | ||
|
||
function renderComponent(data) { | ||
return shallow(<Title surah={data}/>); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ | |
} | ||
img { | ||
display: inline !important; | ||
height: 100%; | ||
&.logo{ | ||
height: 80%; | ||
vertical-align: top; | ||
|
Oops, something went wrong.