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

backspace / prison-rideshare-ui / 18065086725

27 Sep 2025 09:19PM UTC coverage: 83.736% (-6.5%) from 90.207%
18065086725

Pull #201

github

web-flow
Merge 790989ccb into 972e0c448
Pull Request #201: Change to pnpm

253 of 319 branches covered (79.31%)

Branch coverage included in aggregate %.

787 of 923 relevant lines covered (85.27%)

23.47 hits per line

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

87.5
/app/services/sidebar.js
1
/* eslint-disable ember/no-classic-classes, ember/no-get */
2
import classic from 'ember-classic-decorator';
3
import { computed } from '@ember/object';
4
import Service, { inject as service } from '@ember/service';
5

6
import ObjectProxy from '@ember/object/proxy';
7
import PromiseProxyMixin from '@ember/object/promise-proxy-mixin';
8

9
@classic
10
class ObjectPromiseProxy extends ObjectProxy.extend(PromiseProxyMixin) {}
11

12
@classic
13
export default class SidebarService extends Service {
14
  @service
15
  overlaps;
16

17
  @service
18
  store;
19

20
  @service
21
  userSocket;
22

23
  open = false;
75✔
24

25
  @computed('userSocket.present.length')
26
  get userCount() {
27
    const count = this.get('userSocket.present.length');
26✔
28

29
    if (count > 1) {
26!
30
      return count;
×
31
    } else {
32
      return 0;
26✔
33
    }
34
  }
35

36
  @computed
37
  get postsRequest() {
38
    return ObjectPromiseProxy.create({
26✔
39
      promise: this.store.findAll('post').then((posts) => {
40
        return {
26✔
41
          posts,
42
        };
43
      }),
44
    });
45
  }
46

47
  @computed('postsRequest.posts.@each.unread')
48
  get unreadCount() {
49
    let posts = this.get('postsRequest.posts');
59✔
50

51
    if (posts) {
59✔
52
      return posts.filterBy('unread').length;
33✔
53
    } else {
54
      return 0;
26✔
55
    }
56
  }
57

58
  @computed('userCount', 'unreadCount', 'overlaps.count')
59
  get notificationCount() {
60
    // TODO this is untested
61
    return this.userCount + this.unreadCount + this.get('overlaps.count');
96✔
62
  }
63
}
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