Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ef3acc2
Work in progress for #245
naveed-ahmad Dec 11, 2016
465ef5a
Merge branch 'master' of https://github.com/quran/quran.com-frontend …
naveed-ahmad Dec 14, 2016
c7e1f1f
refactored local, local specific fonts, almost done with i18n :)
naveed-ahmad Dec 15, 2016
ff4c393
fixed search break and added other missing translation keys
naveed-ahmad Dec 15, 2016
e722edc
added local switch
naveed-ahmad Dec 15, 2016
d5102a5
fixed the bug
naveed-ahmad Dec 16, 2016
564a3e4
Merge branch 'master' of https://github.com/quran/quran.com-frontend …
naveed-ahmad Dec 16, 2016
8d77638
fixed noscript break
naveed-ahmad Dec 16, 2016
9058a4f
added intl pollyfil
naveed-ahmad Dec 19, 2016
70d0276
replaced double quote with single quote
naveed-ahmad Dec 19, 2016
161ff10
fixing specs
naveed-ahmad Dec 19, 2016
b87506b
formatting
naveed-ahmad Dec 19, 2016
2bf0186
more formatting
naveed-ahmad Dec 19, 2016
11afb12
fixed noscript break
naveed-ahmad Dec 19, 2016
dbfeeb8
fixed the link
naveed-ahmad Dec 19, 2016
1002dde
Merge branch 'noscript_fix' into i18n
naveed-ahmad Dec 19, 2016
85f7eeb
fixed specs using mound instead of shallow
naveed-ahmad Dec 20, 2016
2979a75
Merge branch 'master' of https://github.com/quran/quran.com-frontend …
naveed-ahmad Dec 24, 2016
18f3a01
added arabic local
naveed-ahmad Dec 24, 2016
18c392a
PhantomJS don't support! fixed intl helper with vanilla js
naveed-ahmad Dec 24, 2016
aae5118
added local for bookmark
naveed-ahmad Dec 24, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
PhantomJS don't support! fixed intl helper with vanilla js
  • Loading branch information
naveed-ahmad committed Dec 24, 2016
commit 18c392a123c325bab04373b7e8ebd4fb8e3cd61f
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
src/components/SurahInfo/htmls/*
6 changes: 4 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ module.exports = function(config) {
'karma-sinon',
'karma-webpack',
'karma-chrome-launcher',
'karma-phantomjs-launcher'
'karma-phantomjs-launcher',
'karma-intl-shim'
],

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'chai-sinon', 'sinon'],
frameworks: ['mocha', 'chai-sinon', 'sinon', 'intl-shim'],

// list of files / patterns to load in the browser
files: [
'./node_modules/phantomjs-polyfill/bind-polyfill.js',
'./tests/polyfill/Event.js',
'./node_modules/Intl/locale-data/jsonp/en-US.js',
{pattern: 'static/images/*', watched: false, included: false, served: true},

// Actual tests here
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"url-loader": "0.5.7",
"webpack": "2.1.0-beta.20",
"webpack-isomorphic-tools": "2.5.7",
"react-intl":"2.1.5",
"react-intl": "2.1.5",
"winston": "1.1.2",
"react-inlinesvg": "0.5.4"
},
Expand All @@ -136,6 +136,7 @@
"karma-chai": "0.1.0",
"karma-chai-sinon": "0.1.5",
"karma-chrome-launcher": "0.2.0",
"karma-intl-shim": "1.0.3",
"karma-junit-reporter": "0.3.4",
"karma-mocha": "0.2.0",
"karma-phantomjs-launcher": "~0.2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/locale/ar.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default {
'nav.usefulSites': 'مواقع مفيدة',
'nav.otherLinks': 'روابط اخرى',
'nav.contactUs': 'اتصل بنا',
'nav.aboutQuranProject': 'Quran.com المعروف أيضا باسم القرآن الكريم، قناة القرآن الكريم، القرآن الكريم، القرآن الكريم) هو مشروع خيري)',
'nav.aboutQuranProject': 'Quran.com المعروف أيضا باسم القرآن الكريم، قناة القرآن الكريم، القرآن الكريم، القرآن الكريم) هو مشروع خيري)', // eslint-disable-line max-len
'nav.mobile': 'التليفون المحمول',
'nav.legacySite': 'الموقع القديم'
}
Expand Down
14 changes: 6 additions & 8 deletions tests/helpers/intl-enzyme-test-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,28 @@ import React from 'react';
import { IntlProvider, intlShape } from 'react-intl';
import { mount, shallow } from 'enzyme';

// You can pass your messages to the IntlProvider. Optional: remove if unneeded.
const messages = require('../../src/locale/en.js');

// Create the IntlProvider to retrieve context for wrapping around.
const intlProvider = new IntlProvider({ locale: 'en', messages: messages.messages }, {});
const { intl } = intlProvider.getChildContext();
var intlProvider = new IntlProvider({ locale: 'en' }, {});
var intl = intlProvider.getChildContext();

/**
* When using React-Intl `injectIntl` on components, props.intl is required.
*/
function nodeWithIntlProp(node) {
return React.cloneElement(node, { intl });
return React.cloneElement(node, intl );
}

/**
/**a
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✂️ a

* Export these methods.
*/
export function shallowWithIntl(node) {
return shallow(nodeWithIntlProp(node), { context: { intl } });
return shallow(nodeWithIntlProp(node), { context: intl });
}

export function mountWithIntl(node) {
return mount(nodeWithIntlProp(node), {
context: { intl },
context: intl ,
childContextTypes: { intl: intlShape }
});
}