-
-
Notifications
You must be signed in to change notification settings - Fork 431
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 #688 from christiantinauer/master
Removed option "contextAsConfigBasePath" because the context given to…
- Loading branch information
Showing
24 changed files
with
425 additions
and
212 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 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
File renamed without changes.
File renamed without changes.
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,24 @@ | ||
{ | ||
"name": "option-context", | ||
"license": "MIT", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"devDependencies": { | ||
"@types/jasmine": "^2.8.2", | ||
"@types/react": "^16.0.27", | ||
"@types/react-dom": "^16.0.3", | ||
"@types/react-test-renderer": "^16.0.0", | ||
"babel": "^6.23.0", | ||
"babel-core": "^6.26.0", | ||
"babel-loader": "^7.1.2", | ||
"babel-preset-react-app": "^3.1.0", | ||
"jasmine-core": "^2.8.0", | ||
"react-click-outside": "^3.0.0", | ||
"react-test-renderer": "^16.2.0" | ||
}, | ||
"dependencies": { | ||
"babel-polyfill": "^6.26.0", | ||
"react": "^16.2.0", | ||
"react-dom": "^16.2.0" | ||
} | ||
} |
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 @@ | ||
declare module 'react-click-outside'; |
6 changes: 6 additions & 0 deletions
6
...xtAsConfigBasePath/src/components/App.tsx → ...sts/option-context/src/components/App.tsx
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 |
---|---|---|
@@ -1,8 +1,14 @@ | ||
import React from 'react'; | ||
import enhanceWithClickOutside from 'react-click-outside'; | ||
|
||
const App: React.SFC<{ name: string }> = ({ name }) => | ||
<div className="container-fluid"> | ||
<h1>Hello {name}!</h1> | ||
</div>; | ||
|
||
const COApp = enhanceWithClickOutside(App) | ||
|
||
export default App; | ||
export { | ||
COApp | ||
} |
14 changes: 14 additions & 0 deletions
14
test/execution-tests/option-context/src/components/deep/DeepApp.tsx
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,14 @@ | ||
import React from 'react'; | ||
import enhanceWithClickOutside from 'react-click-outside'; | ||
|
||
const DeepApp: React.SFC<{ name: string }> = ({ name }) => | ||
<div className="container-fluid"> | ||
<h1>Hello {name}!</h1> | ||
</div>; | ||
|
||
const CODeepApp = enhanceWithClickOutside(DeepApp) | ||
|
||
export default DeepApp; | ||
export { | ||
CODeepApp | ||
} |
14 changes: 14 additions & 0 deletions
14
test/execution-tests/option-context/src/components/deep/deeper/DeeperApp.tsx
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,14 @@ | ||
import React from 'react'; | ||
import enhanceWithClickOutside from 'react-click-outside'; | ||
|
||
const DeeperApp: React.SFC<{ name: string }> = ({ name }) => | ||
<div className="container-fluid"> | ||
<h1>Hello {name}!</h1> | ||
</div>; | ||
|
||
const CODeeperApp = enhanceWithClickOutside(DeeperApp) | ||
|
||
export default DeeperApp; | ||
export { | ||
CODeeperApp | ||
} |
File renamed without changes.
69 changes: 69 additions & 0 deletions
69
test/execution-tests/option-context/test/components/App.tests.tsx
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,69 @@ | ||
import React from 'react'; | ||
import { createRenderer } from 'react-test-renderer/shallow'; | ||
|
||
import App, { COApp } from '../../src/components/App'; | ||
import DeepApp, { CODeepApp } from '../../src/components/deep/DeepApp'; | ||
import DeeperApp, { CODeeperApp } from '../../src/components/deep/deeper/DeeperApp'; | ||
|
||
describe('App', () => { | ||
it('simple', () => expect(1).toBe(1)); | ||
|
||
it('renders App as expected HTML', () => { | ||
const shallowRenderer = createRenderer(); | ||
|
||
shallowRenderer.render(<App name="Christian" />); | ||
const app = shallowRenderer.getRenderOutput(); | ||
|
||
expect(app).toEqual( | ||
<div className="container-fluid"> | ||
<h1>Hello { "Christian" }!</h1> | ||
</div> | ||
); | ||
}); | ||
|
||
it('renders ClickOutsideApp', () => { | ||
const shallowRenderer = createRenderer(); | ||
|
||
shallowRenderer.render(<COApp name="Christian" />); | ||
}); | ||
|
||
|
||
it('renders DeepApp as expected HTML', () => { | ||
const shallowRenderer = createRenderer(); | ||
|
||
shallowRenderer.render(<DeepApp name="Christian" />); | ||
const app = shallowRenderer.getRenderOutput(); | ||
|
||
expect(app).toEqual( | ||
<div className="container-fluid"> | ||
<h1>Hello { "Christian" }!</h1> | ||
</div> | ||
); | ||
}); | ||
|
||
it('renders ClickOutsideDeeApp', () => { | ||
const shallowRenderer = createRenderer(); | ||
|
||
shallowRenderer.render(<CODeepApp name="Christian" />); | ||
}); | ||
|
||
|
||
it('renders DeeperApp as expected HTML', () => { | ||
const shallowRenderer = createRenderer(); | ||
|
||
shallowRenderer.render(<DeeperApp name="Christian" />); | ||
const app = shallowRenderer.getRenderOutput(); | ||
|
||
expect(app).toEqual( | ||
<div className="container-fluid"> | ||
<h1>Hello { "Christian" }!</h1> | ||
</div> | ||
); | ||
}); | ||
|
||
it('renders ClickOutsideDeeperApp', () => { | ||
const shallowRenderer = createRenderer(); | ||
|
||
shallowRenderer.render(<CODeeperApp name="Christian" />); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
test/execution-tests/option-context/tsconfig-container/tsconfig.json
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,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es6", | ||
"jsx": "preserve", | ||
"moduleResolution": "node" | ||
}, | ||
"files": [ | ||
"./src/app-shim.d.ts" | ||
] | ||
} |
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
Oops, something went wrong.