@remit/ui 0.0.151 → 0.0.153
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
|
@@ -157,7 +157,7 @@ export function clauseFieldHint(field: ClauseField): string | undefined {
|
|
|
157
157
|
*
|
|
158
158
|
* The vector-free matcher serves `From`/`Subject` from the core thread rows and
|
|
159
159
|
* carries no faithful body, so it rejects a body-text clause outright rather
|
|
160
|
-
* than narrowing the match silently (`
|
|
160
|
+
* than narrowing the match silently (`bodyContentRejection`,
|
|
161
161
|
* backend/service/organize.ts). A rule with no active widen therefore cannot be
|
|
162
162
|
* counted or applied one-time with such a clause in it — it can only be a
|
|
163
163
|
* standing rule, where the index-time matcher reads the whole body.
|
|
@@ -5,9 +5,37 @@ import {
|
|
|
5
5
|
deriveSenderClauses,
|
|
6
6
|
distinctSenders,
|
|
7
7
|
dominantSender,
|
|
8
|
+
senderDomain,
|
|
8
9
|
senderLabel,
|
|
9
10
|
} from "./sender-derivation.js";
|
|
10
11
|
|
|
12
|
+
describe("senderDomain", () => {
|
|
13
|
+
it("keeps the label sitting under a multi-part public suffix", () => {
|
|
14
|
+
assert.equal(senderDomain("a@bbc.co.uk"), "bbc.co.uk");
|
|
15
|
+
assert.equal(senderDomain("a@shop.example.com.au"), "example.com.au");
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("strips subdomains down to the registrable domain", () => {
|
|
19
|
+
assert.equal(senderDomain("news@mail.bbc.co.uk"), "bbc.co.uk");
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("reads the suffix list rather than the trailing labels, so a crafted host cannot pose as one", () => {
|
|
23
|
+
assert.equal(senderDomain("hr@example.co.uk.evil.example"), "evil.example");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("has no domain for a bare public suffix, or for a host carrying none", () => {
|
|
27
|
+
assert.equal(senderDomain("a@co.uk"), null);
|
|
28
|
+
assert.equal(senderDomain("postmaster"), null);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("agrees with the clause the wizard derives, so a suggested domain is one the matcher produces", () => {
|
|
32
|
+
assert.deepEqual(
|
|
33
|
+
deriveSenderClauses(["news@mail.bbc.co.uk", "sport@bbc.co.uk"]),
|
|
34
|
+
[{ field: "FromDomain", value: senderDomain("news@mail.bbc.co.uk") }],
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
11
39
|
describe("distinctSenders", () => {
|
|
12
40
|
it("drops empties and blanks, trimming what remains", () => {
|
|
13
41
|
assert.deepEqual(
|