• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / blurts-server / #13224

pending completion
#13224

push

circleci

flozia
Merge branch 'main' into MNTOR-971-Landing-page-transitions

282 of 1677 branches covered (16.82%)

Branch coverage included in aggregate %.

136 of 136 new or added lines in 15 files covered. (100.0%)

959 of 4545 relevant lines covered (21.1%)

1.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/controllers/exposures.js
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4

5
import { mainLayout } from '../views/mainLayout.js'
6
import { generateToken } from '../utils/csrf.js'
7
import { exposuresSetup } from '../views/partials/exposures-setup.js'
8
import { exposuresList } from '../views/partials/exposures-list.js'
9

10
/**
11
 * @type {import('express').RequestHandler}
12
 */
13
async function exposuresPage (req, res) {
14
  const showDashboard = await hasSetUpExposureScanning(req.user)
×
15

16
  if (!showDashboard) {
×
17
    /**
18
     * @type {MainViewPartialData<import('../views/partials/exposures-setup').PartialParameters>}
19
     */
20
    const data = {
×
21
      partial: exposuresSetup,
22
      csrfToken: generateToken(res, req),
23
      nonce: res.locals.nonce,
24
      fxaProfile: req.user?.fxa_profile_json
25
    }
26
    res.send(mainLayout(data))
×
27
    return
×
28
  }
29

30
  /**
31
   * @type {MainViewPartialData<import('../views/partials/exposures-list').PartialParameters>}
32
   */
33
  const data = {
×
34
    partial: exposuresList,
35
    csrfToken: generateToken(res, req),
36
    nonce: res.locals.nonce,
37
    fxaProfile: req.user?.fxa_profile_json
38
  }
39

40
  res.send(mainLayout(data))
×
41
}
42

43
/**
44
 * @param {import('express').Request['user']} user
45
 * @returns {Promise<boolean>} Whether the user has set up exposure scanning already
46
 */
47
async function hasSetUpExposureScanning (user) {
48
  // TODO: Once the back-end supports storing a user's exposure scan data,
49
  //       check whether it has been entered:
50
  return false
×
51
}
52

53
export { exposuresPage }
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc