Skip to content

Commit

Permalink
style: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
maelgangloff committed May 3, 2024
1 parent b24e5a0 commit f783407
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions test/user.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { describe, expect } from '@jest/globals'
import type { AuthConfig } from '../src/models/Common/Auth'
import type { Evaluation, EvaluationSettings } from '../src/models/Results'
import type { Agenda, HomeworkAssignment } from '../src/models/Calendar'
import { AbsenceFile } from '../src/models/SchoolLife'
import type { AbsenceFile } from '../src/models/SchoolLife'
import { Skolengo } from '../src/index'
import './common'
import { SchoolInfo } from '../src/models/School'
import type { SchoolInfo } from '../src/models/School'

const SKOLENGO_TOKENSET = process.env.SKOLENGO_TOKENSET
const describeAuthenticated = SKOLENGO_TOKENSET !== undefined ? describe : describe.skip
Expand All @@ -27,7 +27,7 @@ describeAuthenticated('Test of the Skolengo API types - Authenticated user', ()

it('should match type AbsenceReason[]', async () => {
const reasons = await user.getAbsenceReasons()
for(const reason of reasons) expect(reason).toMatchSchema('AbsenceReason')
for (const reason of reasons) expect(reason).toMatchSchema('AbsenceReason')
})

/**
Expand All @@ -45,7 +45,7 @@ describeAuthenticated('Test of the Skolengo API types - Authenticated user', ()
})

it('should match the SchoolInfo', async () => {
for (const info of schoolInfoList.slice(0, 2)){
for (const info of schoolInfoList.slice(0, 2)) {
const infoDetail = await user.getSchoolInfo(info.id)
expect(infoDetail).toMatchSchema('SchoolInfo')
}
Expand Down Expand Up @@ -82,7 +82,7 @@ describeAuthenticated('Test of the Skolengo API types - Authenticated user', ()

it('should match type Attachment[]', async () => {
const response = await user.getPeriodicReportsFiles()
for(const attachment of response) expect(attachment).toMatchSchema('Attachment')
for (const attachment of response) expect(attachment).toMatchSchema('Attachment')
})
})

Expand Down Expand Up @@ -128,11 +128,11 @@ describeAuthenticated('Test of the Skolengo API types - Authenticated user', ()
})

it('should match type HomeWorkAssignment[]', () => {
for(const homework of homeworkList) expect(homework).toMatchSchema('HomeworkAssignment')
for (const homework of homeworkList) expect(homework).toMatchSchema('HomeworkAssignment')
})

it('should match type HomeWorkAssignment', async () => {
for(const homework of homeworkList) {
for (const homework of homeworkList) {
const homeworkDetail = await user.getHomeworkAssignment(undefined, homework.id)
expect(homeworkDetail).toMatchSchema('HomeworkAssignment')
}
Expand All @@ -143,19 +143,18 @@ describeAuthenticated('Test of the Skolengo API types - Authenticated user', ()
* Tests d'intégration du module d'absences
*/
describe('Test of the ABS module', () => {

let absenceFiles: AbsenceFile[]

beforeAll(async () => {
absenceFiles = await user.getAbsenceFiles()
})

it('should match type AbsenceFile[]', () => {
for(const file of absenceFiles) expect(file).toMatchSchema('AbsenceFile')
for (const file of absenceFiles) expect(file).toMatchSchema('AbsenceFile')
})

it('should match type AbsenceFile', async () => {
for(const file of absenceFiles) {
for (const file of absenceFiles) {
const fileDetail = await user.getAbsenceFile(file.id)
expect(fileDetail).toMatchSchema('AbsenceFile')
}
Expand Down

0 comments on commit f783407

Please sign in to comment.