Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e080901
reading the project
JoseLLamasT Mar 11, 2021
479c4cf
perf: delete comments
YaniraP Mar 11, 2021
234466b
Merge pull request #2 from JoseLLamasT/server-index-removing-comments
JoseLLamasT Mar 11, 2021
89f29e4
controlleres respond added
JoseLLamasT Mar 11, 2021
db011ac
Merge branch 'master' of https://github.com/JoseLLamasT/lamby into ma…
JoseLLamasT Mar 11, 2021
1aa4efe
develop
JoseLLamasT Mar 11, 2021
9537d3c
settings
JoseLLamasT Mar 12, 2021
ca5e797
typescript fixes and configs have been change
JoseLLamasT Mar 12, 2021
72f17a1
no changes, change branch
YaniraP Mar 12, 2021
746cb48
test render player passed
YaniraP Mar 12, 2021
7a7e565
tests player: 2 test passed
YaniraP Mar 13, 2021
72dcb5a
tests player: 2 test passed
YaniraP Mar 13, 2021
afd171a
tests player: 2 test passed
YaniraP Mar 13, 2021
88b4db9
home test and timer test
JoseLLamasT Mar 13, 2021
da1be83
Merge branch 'testing-matchs' into develop
JoseLLamasT Mar 13, 2021
757ff79
final test player pass
YaniraP Mar 13, 2021
47bf102
final test player pass
YaniraP Mar 13, 2021
d5d5e87
testing mocks
JoseLLamasT Mar 15, 2021
dbd7d70
Merge branch 'testing-back-end' into develop
JoseLLamasT Mar 15, 2021
8e6dcb2
mocks
JoseLLamasT Mar 15, 2021
ec723ed
match tested
JoseLLamasT Mar 15, 2021
1bed347
Merge branch 'testing-back-end' into develop
JoseLLamasT Mar 15, 2021
2a4f899
timer is being render
JoseLLamasT Mar 15, 2021
e971429
timer is being render
JoseLLamasT Mar 15, 2021
da6c50f
test Match Display pass!
YaniraP Mar 15, 2021
7ddab7e
test Match Display pass!
YaniraP Mar 15, 2021
3213ace
NavBar component created
YaniraP Mar 15, 2021
4000209
tasting position halft way
JoseLLamasT Mar 15, 2021
03b1bfc
tasting position halft way
JoseLLamasT Mar 15, 2021
7a340cd
tasting position halft way
JoseLLamasT Mar 15, 2021
860a4de
commit before pull
YaniraP Mar 16, 2021
c97b70e
user Testind Half Way
JoseLLamasT Mar 16, 2021
46685fc
Merge branch 'testing-back-end' into develop
JoseLLamasT Mar 16, 2021
5a72bce
Interfaces IPlayerProp & Itimer moved to their components
YaniraP Mar 16, 2021
3d2aa0d
Merge branch 'develop' of https://github.com/JoseLLamasT/lamby into d…
YaniraP Mar 16, 2021
b2bc958
Merge branch 'refactor-interfaces' into develop
YaniraP Mar 16, 2021
e7c0076
not important
YaniraP Mar 16, 2021
8b76cf8
interfaces splitted
YaniraP Mar 16, 2021
7c300f3
Merge pull request #4 from JoseLLamasT/refactor-interfaces
JoseLLamasT Mar 16, 2021
ddb6d68
refactor fetchRequest
YaniraP Mar 16, 2021
198058f
interfaces splitted
YaniraP Mar 16, 2021
38f28d6
back-end tested missing beforeeach and after
JoseLLamasT Mar 16, 2021
10567c6
Merge branch 'testing-back-end' into develop
JoseLLamasT Mar 16, 2021
5b90f35
Instrucctions splitted
YaniraP Mar 16, 2021
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
23 changes: 23 additions & 0 deletions client/lamby-app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: false,
},
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['react', '@typescript-eslint'],
rules: {
'react/react-in-jsx-scope': 'off',
},
};
4,351 changes: 2,062 additions & 2,289 deletions client/lamby-app/package-lock.json

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion client/lamby-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/react-hooks": "^5.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/jest": "^26.0.15",
"@types/node": "^12.0.0",
Expand All @@ -16,6 +16,8 @@
"react-dom": "^17.0.1",
"react-router-dom": "^5.1.7",
"react-scripts": "4.0.3",
"react-test-render": "^1.1.2",
"react-test-renderer": "^17.0.1",
"typescript": "^4.1.2",
"web-vitals": "^1.0.1"
},
Expand Down Expand Up @@ -44,6 +46,12 @@
]
},
"devDependencies": {
"@testing-library/jest-dom": "^5.11.9",
"@typescript-eslint/eslint-plugin": "^4.17.0",
"@typescript-eslint/parser": "^4.17.0",
"eslint": "^7.21.0",
"eslint-plugin-react": "^7.22.0",
"react-shallow-renderer": "^16.14.1",
"ts-standard": "^10.0.0"
}
}
39 changes: 0 additions & 39 deletions client/lamby-app/src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,6 @@
justify-content: space-between;
height: 100%;
}
.navbar {
width: 100vw;
text-align: center;

ul {
padding: 0;
margin: 0;
margin-block-end: 0;
margin-block-start: 0;
padding-inline-start: 0px;

li {
list-style-type: none;
display: inline-block;
height: 80px;
width: 33%;

a {
color: #e2e2e2;
font-size: 1.2rem;
text-transform: uppercase;
text-decoration: none;
height: calc(100% - 3px);
width: 100%;
border-top: 1px solid #e2e2e2;
border-left: 1px solid #e2e2e2;
border-right: 1px solid #e2e2e2;
border-bottom: 1px solid #e2e2e2;
display: block;
padding-top: 28px;
transition: 0.3s ease background-color;

&:hover {
background: #131726;
}
}
}
}
}

.active {
border-top: 10px solid #fa541f !important;
Expand Down
46 changes: 12 additions & 34 deletions client/lamby-app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,45 +1,23 @@
import './App.scss'
import './App.scss';
import React from 'react';
import {
BrowserRouter as Router,
Switch,
Route,
NavLink,
Route
} from 'react-router-dom';
import Home from './containers/home/Home'
import Match from './containers/match/Match'
import Profile from './containers/profile/Profile'
import AppStateProvider from './context/AppState'
import MatchEditor from './components/matchEditor/MatchEditor'

function App () {




import NavBar from './components/NavBar/NavBar'
import Home from './containers/home/Home';
import Match from './containers/match/Match';
import Profile from './containers/profile/Profile';
import AppStateProvider from './context/AppState';
import MatchEditor from './components/matchEditor/matchEditor';

function App() {
return (
<AppStateProvider>
<div className='App'>
<Router>
<nav className='navbar'>
<ul>
<li>
<NavLink to='/home' activeClassName='active'>
Home
</NavLink>
</li>
<li>
<NavLink to='/match' activeClassName='active'>
Match
</NavLink>
</li>
<li>
<NavLink to='/profile' activeClassName='active'>
Profile
</NavLink>
</li>
</ul>
</nav>
<NavBar/>
<Switch>
<Route path='/match'>
<Match />
Expand All @@ -60,4 +38,4 @@ function App () {
);
}

export default App
export default App;
52 changes: 52 additions & 0 deletions client/lamby-app/src/components/Helpers/InstructionsPlayers.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { IPlayerPosition } from '../../interfaces/IPlayerPosition';

const InstructionsPlayer : IPlayerPosition[] = [
{ code: 'GK', move: 'gk-sb', content: 'Goal keeper stay back' },
{ code: 'GK', move: 'gk-jp', content: 'Goal keeper join play' },
{ code: 'LCB', move: 'lcb-sb', content: 'Stay back during the game' },
{ code: 'LCB', move: 'lcb-ja', content: 'Join attack whenever possible' },
{ code: 'RCB', move: 'rcb-sb', content: 'Stay back during the game' },
{ code: 'RCB', move: 'rcb-ja', content: 'Join the attack whenever possible' },
{
code: 'LB',
move: 'lb-sb',
content: 'Go wide and give crosses on attacking runs',
},
{ code: 'LB', move: 'lb-ja', content: 'Cut inside when joining the attack' },
{
code: 'RB',
move: 'rb-ja',
content: 'Go wide and give crosses on attacking runs',
},
{ code: 'RB', move: 'rb-sb', content: 'Cut inside when joining the attack' },
{ code: 'LDM', move: 'ldm-ot', content: 'Cover center' },
{ code: 'LDM', move: 'ldm-sb', content: 'Cover wing' },
{ code: 'RDM', move: 'rdm-ot', content: 'Cover center' },
{ code: 'RDM', move: 'rdm-sb', content: 'Cover wing' },
{ code: 'CAM', move: 'cam-ot', content: 'Free roam' },
{ code: 'CAM', move: 'cam-sb', content: 'Stay Back' },
{ code: 'LW', move: 'lw-sw', content: 'Stay wide and give crosses' },
{
code: 'LW',
move: 'lw-ci',
content: 'Cut inside and go for the action',
},
{ code: 'RW', move: 'rw-sw', content: 'Stay wide and give crosses' },
{
code: 'RW',
move: 'rw-ci',
content: 'Cut inside and go for the action',
},
{
code: 'ST',
move: 'st-ot',
content: 'Drop back and act like a false 9',
},
{
code: 'ST',
move: 'st-sb',
content: "Make runs and get in behind the opponent's defense",
},
];

export default InstructionsPlayer;
39 changes: 39 additions & 0 deletions client/lamby-app/src/components/NavBar/NavBar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.navbar {
width: 100vw;
text-align: center;

ul {
padding: 0;
margin: 0;
margin-block-end: 0;
margin-block-start: 0;
padding-inline-start: 0px;

li {
list-style-type: none;
display: inline-block;
height: 80px;
width: 33%;

a {
color: #e2e2e2;
font-size: 1.2rem;
text-transform: uppercase;
text-decoration: none;
height: calc(100% - 3px);
width: 100%;
border-top: 1px solid #e2e2e2;
border-left: 1px solid #e2e2e2;
border-right: 1px solid #e2e2e2;
border-bottom: 1px solid #e2e2e2;
display: block;
padding-top: 28px;
transition: 0.3s ease background-color;

&:hover {
background: #131726;
}
}
}
}
}
28 changes: 28 additions & 0 deletions client/lamby-app/src/components/NavBar/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import './NavBar.scss';
import { NavLink } from 'react-router-dom';

const NavBar = () => {
return (
<nav className='navbar'>
<ul>
<li>
<NavLink to='/home' activeClassName='active'>
Home
</NavLink>
</li>
<li>
<NavLink to='/match' activeClassName='active'>
Match
</NavLink>
</li>
<li>
<NavLink to='/profile' activeClassName='active'>
Profile
</NavLink>
</li>
</ul>
</nav>
)
}

export default NavBar;
96 changes: 96 additions & 0 deletions client/lamby-app/src/components/matchDisplay/matchDisplay.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import {Router } from 'react-router-dom';
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import { createMemoryHistory } from 'history';
import MatchDisplay from './matchDisplay';
import {AppStateContext }from '../../context/AppContext';


test('rendering right number of players', async () => {
const history = createMemoryHistory();
const route = '/match';
history.push(route);

render(
<AppStateContext.Provider value={mockPlayerPositions} >
<Router history={history}>
<MatchDisplay />
</Router>
</AppStateContext.Provider>
)

const totalPlayers = await screen.findAllByTestId('player-number-text');
expect(totalPlayers).toHaveLength(11);
})



const mockPlayerPositions = {data: { positions: [
{
position: 'GK',
instruction: '',
matchId: 0,
userId: 0,
},
{
position: 'LCB',
instruction: '',
matchId: 0,
userId: 1,
},
{
position: 'RCB',
instruction: '',
matchId: 0,
userId: 2,
},
{
position: 'LB',
instruction: '',
matchId: 0,
userId: 3,
},
{
position: 'RB',
instruction: '',
matchId: 0,
userId: 4,
},
{
position: 'LDM',
instruction: '',
matchId: 0,
userId: 5,
},
{
position: 'RDM',
instruction: '',
matchId: 0,
userId: 6,
},
{
position: 'LW',
instruction: '',
matchId: 0,
userId: 7,
},
{
position: 'RW',
instruction: '',
matchId: 0,
userId: 8,
},
{
position: 'ST',
instruction: '',
matchId: 0,
userId: 9,
},
{
position: 'ST',
instruction: '',
matchId: 0,
userId: 10,
}
]
}};
Loading