@things-factory/notification 10.1.257 → 10.1.259

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/notification",
3
- "version": "10.1.257",
3
+ "version": "10.1.259",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -32,17 +32,17 @@
32
32
  "@operato/layout": "^10.0.0",
33
33
  "@operato/shell": "^10.29.69",
34
34
  "@operato/styles": "^10.0.0",
35
- "@things-factory/auth-base": "^10.1.257",
36
- "@things-factory/email-base": "^10.1.254",
37
- "@things-factory/i18n-base": "^10.1.257",
38
- "@things-factory/organization": "^10.1.257",
39
- "@things-factory/setting-base": "^10.1.257",
40
- "@things-factory/shell": "^10.1.254",
35
+ "@things-factory/auth-base": "^10.1.259",
36
+ "@things-factory/email-base": "^10.1.259",
37
+ "@things-factory/i18n-base": "^10.1.259",
38
+ "@things-factory/organization": "^10.1.259",
39
+ "@things-factory/setting-base": "^10.1.259",
40
+ "@things-factory/shell": "^10.1.259",
41
41
  "clipboard": "^2.0.6",
42
42
  "firebase": "^9.14.0",
43
43
  "firebase-admin": "^11.3.0",
44
44
  "google": "^2.1.0",
45
45
  "marked": "^15.0.0"
46
46
  },
47
- "gitHead": "885b594299601ca4936f4f39701d6713273bbf1e"
47
+ "gitHead": "e7283779ee700b4b124226f0ad22d7c1e4063ae7"
48
48
  }
@@ -0,0 +1,19 @@
1
+ /*
2
+ * What one telling sent, as the thing it told of keeps it (ADR-0164) - an announcement, an approval.
3
+ */
4
+ import { noticeDeliveryOf, withNoticeDelivery } from '../server/controllers/notice/notice-delivery-record'
5
+
6
+ describe('the notice delivery record', () => {
7
+ it('★ each telling is kept - what went out, or that nothing could go', () => {
8
+ const at = new Date('2026-10-26T09:00:00Z')
9
+ const sent = { receivers: 3, email: { sent: 2, failed: 1 }, teams: { sent: 0, failed: 0 } }
10
+ expect(noticeDeliveryOf('published', sent, 3, at)).toEqual({ at: '2026-10-26T09:00:00.000Z', kind: 'published', ...sent })
11
+ expect(noticeDeliveryOf('request', undefined, 4, at)).toEqual({ at: '2026-10-26T09:00:00.000Z', kind: 'request', receivers: 4, email: { sent: 0, failed: 0 }, teams: { sent: 0, failed: 0 }, failed: true })
12
+ })
13
+
14
+ it('the record keeps the newest fifty', () => {
15
+ const many = Array.from({ length: 50 }, (_, i) => i)
16
+ expect(withNoticeDelivery(many, 50)).toEqual(Array.from({ length: 50 }, (_, i) => i + 1))
17
+ expect(withNoticeDelivery(null, 1)).toEqual([1])
18
+ })
19
+ })