Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard bugg #9

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
82473f3
installation
Jan 18, 2022
16c27ce
rajout des .catch dans Login.js
Jan 19, 2022
47c7631
sortedBilled OK
Jan 19, 2022
392121d
error and lodin page tests
Jan 19, 2022
2ce444d
tests Bills.js terminé
Jan 19, 2022
5e5bd9c
commentaire
Jan 19, 2022
44a3178
début des newBills Tests
Jan 19, 2022
8d72426
test git
Jan 19, 2022
4c51cce
tests handleSubmit NewBills ok
Jan 19, 2022
07ca246
test du format de l'image lors de la soumission d'un newBill
Jan 20, 2022
3821bf0
commentaire et modif code
Jan 20, 2022
27212e4
commentaire + test si la modale s'ouvre lors du clique sur un oeil
Jan 21, 2022
3d8d7d6
commentaire
Jan 21, 2022
5d382e8
ajout des tests d'intégration de bills.js
Jan 21, 2022
b541439
ajout de commantaires istanbul ignore next
Jan 21, 2022
1a97cfc
ajout de la vérification de 'licone mail en surbrillance si on est su…
Jan 21, 2022
9be8c77
modif commentaire
Jan 21, 2022
0b2238d
com
Jan 22, 2022
e1e638e
modif css image justif (width à 100%)
Jan 22, 2022
b508695
css image justif dashboard + com
Jan 22, 2022
b027dd1
fix bug newBill
Jan 23, 2022
9e66b69
fix vertical navbar srcoll
Jan 23, 2022
4a74f88
commentaire dashboard.js
Jan 23, 2022
46260c3
com
Jan 23, 2022
e6ccb5b
fix bug 4
Jan 24, 2022
0f21464
fix bug 4
Jan 24, 2022
a2ddf40
test d(integration post
Jan 25, 2022
5b01834
com
Jan 25, 2022
5e9a673
ras
Jan 25, 2022
72a3b69
ajout d ela balise accept sur le justificatif
Jan 25, 2022
be5eef6
100% ok
Jan 26, 2022
576bd67
dernier réglages
Jan 26, 2022
5efea78
commentaire
Feb 1, 2022
f5a1e55
ajout des tests e2e
Feb 1, 2022
bccace6
derniere retouche
Feb 9, 2022
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
Prev Previous commit
derniere retouche
  • Loading branch information
kirmann committed Feb 9, 2022
commit bccace695704f4b23fe6856cfe35ec53a361cc13
1 change: 1 addition & 0 deletions src/__tests__/Bills.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ describe('Given i am on bills page',()=>{
test('Should called the handleClickIconEye when i click on iconEye',()=>{
const html = BillsUI({ data: bills })
document.body.innerHTML = html
let pathname = ROUTES_PATH['Bills']
const bill= new Bills({
document,
onNavigate: (pathname) => document.body.innerHTML = ROUTES({ pathname })
Expand Down
13 changes: 8 additions & 5 deletions src/__tests__/NewBill.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("Given I am connected as an employee", () => {
test('Then, I submit form-new-bill, handleSubmit called',()=>{
const html = NewBillUI()
document.body.innerHTML = html

let pathname = ROUTES_PATH['NewBill']
const onNavigate = (pathname) => {
document.body.innerHTML = ROUTES({ pathname })
}
Expand All @@ -52,16 +52,15 @@ describe("Given I am connected as an employee", () => {
test('Then, I click on Justificatif, handleChangeFile called',()=> {
const html = NewBillUI()
document.body.innerHTML = html
let pathname = ROUTES_PATH['NewBill']
const onNavigate = (pathname) => {
document.body.innerHTML = ROUTES({ pathname })
}

// modifie le localStorage par le localStorageMock
Object.defineProperty(window, 'localStorage', { value: localStorageMock })
window.localStorage.setItem('user', JSON.stringify({type: 'Employee'}))
let store = jest.fn()
let localStorage = window.localStorage
const newBill = new NewBill({document, onNavigate, store , localStorage})
window.localStorage.setItem('user', JSON.stringify({type: 'Employee'}))
const newBill = new NewBill({document, onNavigate})
const handleChangeFile = jest.fn(newBill.handleChangeFile)
const fileBtn = screen.getByTestId('file')
expect(fileBtn).toBeDefined()
Expand All @@ -80,6 +79,8 @@ describe("When I select a file", () => {
window.localStorage.setItem('user', JSON.stringify({type: 'Employee'}))// Set user as Employee in localStorage
const html = NewBillUI()
document.body.innerHTML = html
let pathname = ROUTES_PATH['NewBill']

const newBill = new NewBill({
document,
onNavigate: (pathname) => document.body.innerHTML = ROUTES({ pathname }),
Expand Down Expand Up @@ -107,6 +108,8 @@ describe("Given I am a user connected as Admin", () => {
test("fetches bills from mock API POST", async () => {
const html = NewBillUI()
document.body.innerHTML = html
let pathname = ROUTES_PATH['NewBill']

const onNavigate = (pathname) => {
document.body.innerHTML = ROUTES({ pathname })
}
Expand Down
1 change: 1 addition & 0 deletions src/containers/Bills.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default class {
const buttonNewBill = document.querySelector(`button[data-testid="btn-new-bill"]`)
if (buttonNewBill) buttonNewBill.addEventListener('click', this.handleClickNewBill)
const iconEye = document.querySelectorAll(`div[data-testid="icon-eye"]`)
// istanbul ignore next
if (iconEye) iconEye.forEach(icon => {
icon.addEventListener('click', (e) => this.handleClickIconEye(icon))
})
Expand Down
9 changes: 1 addition & 8 deletions src/containers/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,7 @@ export default class {
// $(`#open-bill${bill.id}`).click((e) => this.handleEditTicket(e, bill, bills))
$(`#open-bill${bill.id}`, `#status-bills-container${this.index}` ).click((e) => {
this.handleEditTicket(e, bill, bills)
})
// let var1 = $(`#status-bills-container${this.index}` )
// console.log('conteneur' , var1);
// let var2 = $(`#open-bill${bill.id}`)
// console.log('var2',var2);
let all = $(`#open-bill${bill.id}`, `#status-bills-container${this.index}` )
console.log('all', all);

})
})

return bills
Expand Down