-
Notifications
You must be signed in to change notification settings - Fork 25
svcid
checks for enabling notifications
#152
Conversation
Codecov Report
@@ Coverage Diff @@
## master #152 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 20 20
Lines 1109 1114 +5
Branches 186 188 +2
=========================================
+ Hits 1109 1114 +5
Continue to review full report at Codecov.
|
src/omnibar/omnibar.ts
Outdated
const CLS_EXPANDED = 'sky-omnibar-iframe-expanded'; | ||
const CLS_LOADING = 'sky-omnibar-loading'; | ||
|
||
const notificationSvcIds: any = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would either create an interface for this or declare a type inline:
const notificationSvcIds: {
[key: string]: {
requiresNotif: boolean
}
} = {
...
}
src/omnibar/omnibar.spec.ts
Outdated
|
||
fireMessageEvent({ | ||
messageType: 'get-token', | ||
tokenRequestId: 123 | ||
}); | ||
}); | ||
|
||
describe('handle notifications per svcid', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nested describe
should follow the parent describe
logically as if it were a sentence, so since the outer describe is "Omnibar," maybe this describe should be "when connecting to notifications," then describe the action in the it
blocks.
src/omnibar/omnibar.spec.ts
Outdated
}); | ||
} | ||
|
||
it('renxt', (done) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it
blocks start with "should" and describe the actions under test. I would combine these 4 tests into 1 and call it "should respect the notification settings for a given service ID."
6d13572
281243c
Logic:
Showing the bell in the the LE/ENV context:
If the org has
notif
AND (renxt
orfenxt
) » show the bellShowing the bell when there is no LE context:
If
svcid
==skydev
» show the bell