mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-11 15:10:48 +02:00
2838c6d38c
[web] convert final acceptance tests to es modules GitOrigin-RevId: d0d0cd3dfedbe494ce51dd6f8c180dff02429ad8
42 lines
769 B
JavaScript
42 lines
769 B
JavaScript
import AbstractMockApi from './AbstractMockApi.mjs'
|
|
|
|
class MockAnalyticsApi extends AbstractMockApi {
|
|
reset() {
|
|
this.updates = {}
|
|
}
|
|
|
|
applyRoutes() {
|
|
this.app.get('/graphs/:graph', (req, res) => {
|
|
return res.json({})
|
|
})
|
|
|
|
this.app.get('/recentInstitutionActivity', (req, res) => {
|
|
res.json({
|
|
institutionId: 123,
|
|
day: {
|
|
projects: 0,
|
|
users: 0,
|
|
},
|
|
week: {
|
|
projects: 0,
|
|
users: 0,
|
|
},
|
|
month: {
|
|
projects: 1,
|
|
users: 2,
|
|
},
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
export default MockAnalyticsApi
|
|
|
|
// type hint for the inherited `instance` method
|
|
/**
|
|
* @function instance
|
|
* @memberOf MockAnalyticsApi
|
|
* @static
|
|
* @returns {MockAnalyticsApi}
|
|
*/
|