-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Chetan-KK/Windows-10-Clone
- Loading branch information
Showing
28 changed files
with
19,875 additions
and
1,936 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env", | ||
[ | ||
"@babel/preset-react", | ||
{ | ||
"runtime": "automatic" | ||
} | ||
] | ||
] | ||
} |
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,3 @@ | ||
module.exports = { | ||
extends: ["react-app", "react-app/jest"], | ||
}; |
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
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import "@testing-library/jest-dom"; | ||
// import "@testing-library/jest-dom/extend-expect"; |
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,63 @@ | ||
import React from "react"; | ||
import { screen, render, waitFor } from "@testing-library/react"; | ||
import App from "./Components/App"; | ||
import userEvent from "@testing-library/user-event"; | ||
import Quit from "./Components/Quit"; | ||
|
||
|
||
test("Initial test", () => { | ||
render(<App />) | ||
expect(true).toBe(true) | ||
}) | ||
|
||
test("the loading screen is loading properly", async () => { | ||
render(<App />) | ||
let loadingScreen = screen.getByText(/please wait/i) | ||
expect(loadingScreen).toBeInTheDocument() | ||
|
||
await waitFor(() => { | ||
expect(screen.getByText(/eng/i)).toBeInTheDocument() | ||
expect(loadingScreen).not.toBeInTheDocument() | ||
}, { timeout: 3000 }) | ||
}) | ||
|
||
test("The Start button is functioning properly", async () => { | ||
render(<App />) | ||
|
||
await waitFor(async () => { | ||
const startButton = screen.getByTestId("startButton") | ||
expect(startButton).toBeInTheDocument() | ||
|
||
// const user = userEvent.setup() | ||
const startDiv = screen.getByTestId("startMenuDiv") | ||
expect(startDiv).not.toHaveFocus() | ||
await userEvent.click(startButton) | ||
const chrome = screen.getByText(/chrome/i) | ||
const vsCode = screen.getByText(/vs code/i) | ||
expect(chrome).toBeVisible() | ||
expect(vsCode).toBeVisible() | ||
|
||
expect(startDiv).toHaveFocus() | ||
|
||
}, { timeout: 5000 }) | ||
|
||
}) | ||
|
||
test("Start button closing and losing focus when other areas are clicke", async () => { | ||
render(<App />) | ||
await waitFor(async () => { | ||
const startButton = screen.getByTestId("startButton") | ||
const backgroundImage = screen.getByAltText(/windowsBackGroundImage/i) | ||
const startDiv = screen.getByTestId("startMenuDiv") | ||
|
||
await userEvent.click(startButton) | ||
expect(startDiv).toHaveFocus() | ||
|
||
await userEvent.click(backgroundImage) | ||
|
||
expect(startDiv).not.toHaveFocus() | ||
|
||
}, { timeout: 5000 }) | ||
}) | ||
|
||
|
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,50 @@ | ||
import React from 'react' | ||
import { Oval } from 'react-loader-spinner' | ||
import "./css/Loading.css" | ||
|
||
function Loading({ message }) { | ||
return ( | ||
<div className='loadingCircle'> | ||
<Oval | ||
height={80} | ||
width={80} | ||
color="#ffffff" | ||
wrapperStyle={{}} | ||
wrapperClass="" | ||
visible={true} | ||
ariaLabel='oval-loading' | ||
secondaryColor="#6b7280" | ||
strokeWidth={2} | ||
strokeWidthSecondary={3} | ||
/> | ||
{/* <TestLoading /> */} | ||
<div | ||
style={{ | ||
textTransform: " capitalize", | ||
color: "white", | ||
marginTop: 10, | ||
fontSize: 22 | ||
}} | ||
> | ||
<p>{message}</p> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
function TestLoading() { | ||
return ( | ||
<div style={{ "--size": "64px", "--dot-size ": "6px", "--dot-count": 6, "--color": "#fff", "--speed": "1s", "--spread": "60deg" }} className="dots"> | ||
<div style={{ "--i": 0 }} className="dot"></div> | ||
<div style={{ "--i": 1 }} className="dot"></div> | ||
<div style={{ "--i": 2 }} className="dot"></div> | ||
<div style={{ "--i": 3 }} className="dot"></div> | ||
<div style={{ "--i": 4 }} className="dot"></div> | ||
<div style={{ "--i": 5 }} className="dot"></div> | ||
</div> | ||
) | ||
} | ||
|
||
|
||
|
||
export default Loading |
Oops, something went wrong.