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

super3 / nilo.chat / 14179023622

31 Mar 2025 06:46PM UTC coverage: 95.652% (-2.0%) from 97.627%
14179023622

push

github

super3
Fix Tests

124 of 130 branches covered (95.38%)

Branch coverage included in aggregate %.

2 of 2 new or added lines in 1 file covered. (100.0%)

9 existing lines in 3 files now uncovered.

206 of 215 relevant lines covered (95.81%)

6.56 hits per line

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

96.64
/src/components/DirectMessageSidebar.vue
1
<template>
2
  <div class="bg-indigo-darker text-purple-lighter flex-none w-64 pb-6 hidden md:block">
3
    <div class="text-white mb-2 mt-3 px-4 flex justify-between">
4
      <div class="flex-auto">
1✔
5
        <h1 class="font-semibold text-xl leading-tight mb-1 truncate">nilo.chat</h1>
6
        <div class="flex items-center mb-6">
7
          <span :class="[isConnected ? 'bg-green-500' : 'border border-white', 'rounded-full block w-2 h-2 mr-2']"></span>
1✔
8
          <span class="text-white/50 text-sm">{{ username }}</span>
1✔
9
        </div>
10
      </div>
11
    </div>
12
    
13
    <!-- Channels section -->
14
    <div class="mb-8">
15
      <div class="px-4 mb-1 text-white flex items-center">
16
        <div @click="toggleChannels" class="cursor-pointer w-4 mr-2 flex justify-center">
17
          <svg v-if="showChannels" class="fill-current h-4 w-4 opacity-50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
18
            <path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"/>
19
          </svg>
20
          <svg v-else class="fill-current h-4 w-4 opacity-50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
21
            <path d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"/>
22
          </svg>
23
        </div>
24
        <div @click="toggleChannels" class="opacity-75 flex-1 cursor-pointer">Channels</div>
25
        <div>
26
          <svg class="fill-current h-4 w-4 opacity-50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
27
            <path d="M11 9h4v2h-4v4H9v-4H5V9h4V5h2v4zm-1 11a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16z" />
28
          </svg>
29
        </div>
23✔
30
      </div>
31
      <!-- Show all channels when showChannels is true -->
32
      <div v-if="showChannels">
33
        <div 
34
          @click="switchChannel('general')" 
35
          class="px-4 py-1 text-white flex items-center cursor-pointer hover:bg-teal-darker"
36
          :class="{ 'bg-teal-dark': currentChannel === 'general' }"
4✔
37
        >
38
          <div class="w-4 mr-2 text-center">#</div>
39
          <span>general</span>
4✔
40
        </div>
41
        <div 
42
          @click="switchChannel('feedback')" 
7✔
43
          class="px-4 py-1 text-white flex items-center cursor-pointer hover:bg-teal-darker"
6✔
44
          :class="{ 'bg-teal-dark': currentChannel === 'feedback' }"
45
        >
46
          <div class="w-4 mr-2 text-center">#</div>
47
          <span>feedback</span>
48
        </div>
1✔
49
      </div>
50
      <!-- Show only selected channel when showChannels is false -->
1✔
51
      <div v-else>
52
        <div 
53
          v-if="currentChannel === 'general'"
1✔
54
          @click="switchChannel('general')" 
1✔
55
          class="px-4 py-1 text-white flex items-center cursor-pointer hover:bg-teal-darker bg-teal-dark"
1✔
56
        >
57
          <div class="w-4 mr-2 text-center">#</div>
58
          <span>general</span>
1✔
59
        </div>
60
        <div 
61
          v-if="currentChannel === 'feedback'"
1✔
62
          @click="switchChannel('feedback')" 
63
          class="px-4 py-1 text-white flex items-center cursor-pointer hover:bg-teal-darker bg-teal-dark"
64
        >
1✔
65
          <div class="w-4 mr-2 text-center">#</div>
66
          <span>feedback</span>
67
        </div>
1✔
68
      </div>
69
    </div>
70
    
1✔
71
    <!-- Direct Messages section -->
72
    <div class="mb-8">
73
      <div class="px-4 mb-1 text-white flex items-center">
1✔
74
        <div @click="toggleDirectMessages" class="cursor-pointer w-4 mr-2 flex justify-center">
75
          <svg v-if="showDirectMessages" class="fill-current h-4 w-4 opacity-50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
76
            <path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"/>
1✔
77
          </svg>
78
          <svg v-else class="fill-current h-4 w-4 opacity-50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
79
            <path d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"/>
80
          </svg>
81
        </div>
82
        <div @click="toggleDirectMessages" class="opacity-75 flex-1 cursor-pointer">Direct Messages</div>
1✔
83
        <div>
84
          <svg class="fill-current h-4 w-4 opacity-50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
85
            <path d="M11 9h4v2h-4v4H9v-4H5V9h4V5h2v4zm-1 11a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16z" />
86
          </svg>
87
        </div>
88
      </div>
1✔
89
      <!-- Show all DMs when expanded -->
90
      <div v-if="showDirectMessages">
91
        <div class="px-4 py-1 flex items-center cursor-pointer hover:bg-teal-darker"
1✔
92
             :class="{ 'bg-teal-dark': currentChannel === 'dm_self' }"
93
             @click="switchChannel('dm_self')"
94
             data-testid="dm-self">
1✔
95
          <div class="w-4 mr-2 flex justify-center">
96
            <span :class="[isConnected ? 'bg-green-500' : 'border border-white', 'rounded-full block w-2 h-2']"></span>
97
          </div>
1✔
98
          <span class="text-white opacity-75">{{ username }} <span class="text-gray-500 text-sm">(you)</span></span>
99
        </div>
100
        <div class="px-4 py-1 flex items-center cursor-pointer hover:bg-teal-darker" 
101
             :class="{ 'bg-teal-dark': currentChannel === 'dm_steve' }"
102
             @click="switchChannel('dm_steve')"
103
             data-testid="dm-steve">
1✔
104
          <div class="w-4 mr-2 flex justify-center">
105
            <span class="bg-green-500 rounded-full block w-2 h-2"></span>
106
          </div>
107
          <span class="text-white opacity-75">steve</span>
108
          <div v-if="steveUnreadCount > 0" class="ml-auto">
109
            <span class="bg-red-500 text-white text-xs rounded-full py-1 px-2 font-semibold">
1✔
110
              {{ steveUnreadCount }}
111
            </span>
112
          </div>
1✔
113
        </div>
114
      </div>
115
      <!-- Since DMs don't have a 'selected' concept, we won't show any when collapsed -->
1✔
116
    </div>
117
  </div>
118
</template>
1✔
119

120
<script>
121
export default {
122
  name: 'DirectMessageSidebar',
1✔
123
  props: {
124
    username: {
125
      type: String,
126
      required: true
42✔
127
    },
128
    isConnected: {
129
      type: Boolean,
42✔
130
      default: false
131
    },
1✔
132
    currentChannel: {
133
      type: String,
100✔
134
      default: 'general'
135
    },
12✔
136
    steveUnreadCount: {
137
      type: Number,
138
      default: 0
1✔
139
    }
140
  },
65✔
141
  data() {
142
    return {
143
      showChannels: true,
144
      showDirectMessages: true
145
    }
146
  },
42✔
UNCOV
147
  methods: {
✔
148
    toggleChannels() {
149
      this.showChannels = !this.showChannels;
150
    },
151
    toggleDirectMessages() {
58✔
152
      this.showDirectMessages = !this.showDirectMessages;
153
    },
154
    switchChannel(channel) {
1✔
155
      if (channel !== this.currentChannel) {
156
        this.$emit('channel-change', channel);
157
      }
158
    }
58✔
159
  }
160
}
161
</script> 
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

© 2026 Coveralls, Inc