Add interface for hjarntorget and skkolplattformen
This commit is contained in:
parent
aeeab7feb6
commit
2162221322
|
@ -21,7 +21,7 @@ describe('api', () => {
|
|||
fetch = jest.fn().mockResolvedValue(response)
|
||||
response.text.mockResolvedValue('<html></html>')
|
||||
CookieManager.clearAll()
|
||||
api = init(fetch, CookieManager)
|
||||
api = init(fetch, CookieManager) as ApiSkolplattformen
|
||||
})
|
||||
describe('#login', () => {
|
||||
it('exposes token', async () => {
|
||||
|
|
|
@ -27,6 +27,7 @@ import * as parse from './parse/index'
|
|||
import wrap, { Fetcher, FetcherOptions } from '../../api/lib/fetcher'
|
||||
import * as fake from './fakeData'
|
||||
import { checkStatus } from './loginStatusChecker'
|
||||
import { Api } from '../../api/lib/api'
|
||||
|
||||
const fakeResponse = <T>(data: T): Promise<T> =>
|
||||
new Promise((res) => setTimeout(() => res(data), 200 + Math.random() * 800))
|
||||
|
@ -49,7 +50,7 @@ interface SSOSystems {
|
|||
[name: string]: boolean | undefined
|
||||
}
|
||||
|
||||
export class ApiSkolplattformen extends EventEmitter {
|
||||
export class ApiSkolplattformen extends EventEmitter implements Api {
|
||||
private fetch: Fetcher
|
||||
|
||||
private personalNumber?: string
|
||||
|
|
|
@ -11,7 +11,7 @@ import {
|
|||
Skola24Child,
|
||||
EtjanstChild,
|
||||
TimetableEntry,
|
||||
ScheduleItem
|
||||
ScheduleItem,
|
||||
} from './types'
|
||||
|
||||
export interface Api {
|
||||
|
|
Loading…
Reference in New Issue