forked from nightwatchjs/html-reporter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Component Tests (nightwatchjs#17)
* Add: basic component test for Header and Footer * updated @nightwatch/react plugin * updated chromedriver * Update node.js.yml * updated test task * update nightwatch to alpha * update: GA workflow to include 20.x nodejs --------- Co-authored-by: Andrei Rusu <[email protected]> Co-authored-by: Andrei Rusu <[email protected]>
- Loading branch information
1 parent
e7a81e1
commit ae29e6d
Showing
11 changed files
with
7,968 additions
and
13,885 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,4 @@ html/ | |
vrt/ | ||
*.tgz | ||
tests_output | ||
.cache |
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,21 @@ | ||
import Footer from '../../src/components/Footer'; | ||
import { ComponentStory, ComponentMeta } from '@storybook/react'; | ||
import GlobalStyles from '../../src/components/GlobalStyles'; | ||
import { GlobalContext } from '../../src/contexts/GlobalContext'; | ||
|
||
export default { | ||
title: 'Footer Component', | ||
component: Footer | ||
}; | ||
|
||
export const FooterComponent = () => ( | ||
<> | ||
<GlobalStyles /> | ||
<Footer /> | ||
</> | ||
); | ||
|
||
FooterComponent.test = async (browser) => { | ||
browser.pause(1000); | ||
// expect(FooterComponent).to.be.visible; | ||
}; |
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,25 @@ | ||
import Header from '../../src/components/Header'; | ||
import GlobalStyles from '../../src/components/GlobalStyles'; | ||
import { GlobalContextProvider } from '../utils/TestGlobalContextProvider'; | ||
|
||
export default { | ||
title: 'Header Component', | ||
component: Header | ||
}; | ||
|
||
export const HeaderComponent = () => ( | ||
<> | ||
<GlobalContextProvider | ||
value={{ | ||
metadata: { date: '2022-12-21T09:07:54.770Z' } | ||
}}> | ||
<GlobalStyles /> | ||
<Header /> | ||
</GlobalContextProvider> | ||
</> | ||
); | ||
|
||
HeaderComponent.test = async (browser) => { | ||
browser.pause(1000); | ||
// expect(HeaderComponent).to.be.visible; | ||
}; |
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,11 @@ | ||
import React, { ReactNode } from 'react'; | ||
import { GlobalContext } from '../../src/contexts/GlobalContext'; | ||
|
||
type GlobalContextProps = { | ||
children: ReactNode; | ||
value: any; | ||
}; | ||
|
||
export const GlobalContextProvider: React.FC<GlobalContextProps> = ({ children, value }) => { | ||
return <GlobalContext.Provider value={value}>{children}</GlobalContext.Provider>; | ||
}; |
Oops, something went wrong.