forked from Arquisoft/wiq_0
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Arquisoft/wiq_es3a
- Loading branch information
Showing
11 changed files
with
126 additions
and
20 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,37 @@ | ||
.home{ | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
height: 94vh; | ||
background-image: linear-gradient(to top, rgba(255, 0, 0, 0), #ee0e5173); | ||
} | ||
|
||
.tituloHome{ | ||
padding-bottom: 2vh; | ||
} | ||
|
||
.tituloHome_h1{ | ||
padding-bottom: 2vh; | ||
font-weight: 800!important; | ||
font-size: 3em!important; | ||
} | ||
|
||
.botonHome{ | ||
background-color: var(--rosa) !important; | ||
} | ||
|
||
.boxHome{ | ||
display: flex; | ||
flex-direction: column; | ||
background-color: #ffffff7a; | ||
padding-bottom: 1.5em; | ||
border-radius: 1em; | ||
padding-right: 50px; | ||
padding-left: 50px; | ||
} | ||
|
||
.imagenHome{ | ||
padding-top: 10vh; | ||
padding-bottom: 10vh; | ||
} |
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,30 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import Home from './Home'; | ||
import userEvent from '@testing-library/user-event'; | ||
import {BrowserRouter} from 'react-router-dom'; | ||
|
||
let assignMock = jest.fn(); | ||
|
||
delete window.location; | ||
window.location = { assign: assignMock }; | ||
|
||
afterEach(() => { | ||
assignMock.mockClear(); | ||
}); | ||
|
||
|
||
test('iniciar', () => { | ||
render(<Home />); | ||
const linkElement = screen.getByText(/BIENVENIDO/i); | ||
expect(linkElement).toBeInTheDocument(); | ||
expect(screen.getByText(/PULSA EL BOTÓN PARA JUGAR/i)).toBeInTheDocument(); | ||
}); | ||
|
||
test('jugar', async () => { | ||
render(<Home />, {wrapper: BrowserRouter}); | ||
const user = userEvent.setup() | ||
const jugarButton = screen.getByRole('button', { name: /JUGAR/i }); | ||
await user.click(jugarButton); | ||
//expect(screen.getByText(/Loading questions.../i)).toBeInTheDocument() | ||
|
||
}); |
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 |
---|---|---|
|
@@ -26,6 +26,6 @@ | |
} | ||
|
||
.nav-menu a.active { | ||
background-color: #04AA6D; | ||
background-color: var(--rosa); | ||
color: white; | ||
} |
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,27 @@ | ||
import { render, screen, fireEvent } from '@testing-library/react'; | ||
import QuizGame from './QuizGame'; | ||
import axios from 'axios'; | ||
import MockAdapter from 'axios-mock-adapter'; | ||
|
||
const mockAxios = new MockAdapter(axios); | ||
|
||
beforeEach(() => { | ||
mockAxios.reset(); | ||
}); | ||
|
||
test('Pregunta correcta', () => { | ||
mockAxios.onGet('http://localhost:8000/generate-question').reply(200, { | ||
question: "pregunta", | ||
correctAnswer: "correcta", | ||
allAnswers: ["correcta","no1","no2","no3"]}); | ||
|
||
render(<QuizGame />); | ||
expect(screen.getByText(/Loading questions.../i)).toBeInTheDocument(); | ||
|
||
|
||
|
||
const correcta = screen.getByRole('button', { name: /correcta/i }); | ||
fireEvent.click(correcta); | ||
|
||
|
||
}); |
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