@jsb188/app 1.1.10 → 1.1.12
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 +57 -45
- package/src/constants/agent.ts +51 -41
- package/src/constants/app.ts +34 -13
- package/src/constants/emoji.ts +9144 -8936
- package/src/constants/other.ts +1 -5
- package/src/constants/user.ts +16 -25
- package/src/constants/wsActions.ts +27 -0
- package/src/i18n/account.ts +129 -107
- package/src/i18n/agent.ts +331 -73
- package/src/i18n/agentToolBusiness.ts +196 -0
- package/src/i18n/agentToolGrid.ts +137 -0
- package/src/i18n/agentToolWorkflow.ts +101 -0
- package/src/i18n/agent_note.ts +109 -0
- package/src/i18n/app.ts +107 -91
- package/src/i18n/auth.ts +117 -102
- package/src/i18n/billing.ts +5 -92
- package/src/i18n/c.ts +907 -0
- package/src/i18n/campaign.ts +919 -0
- package/src/i18n/country.ts +248 -248
- package/src/i18n/datetime.ts +32 -26
- package/src/i18n/editor.ts +58 -0
- package/src/i18n/error.ts +577 -192
- package/src/i18n/field_doc_editor.ts +21 -0
- package/src/i18n/field_doc_programs.ts +52 -0
- package/src/i18n/field_docs.ts +190 -0
- package/src/i18n/index.ts +42 -19
- package/src/i18n/log.ts +272 -238
- package/src/i18n/memory.ts +53 -0
- package/src/i18n/message.ts +3 -4
- package/src/i18n/note.ts +19 -0
- package/src/i18n/org.ts +164 -109
- package/src/i18n/schedule.ts +209 -0
- package/src/i18n/sheet.ts +333 -4
- package/src/i18n/sheet_formula.ts +165 -0
- package/src/i18n/workflow.ts +109 -23
- package/src/main.ts +68 -64
- package/src/platform.ts +90 -49
- package/src/types/ai.d.ts +52 -23
- package/src/types/app.d.ts +95 -44
- package/src/types/auth.d.ts +66 -40
- package/src/types/console.d.ts +3 -0
- package/src/types/other.d.ts +13 -6
- package/src/types.d.ts +12 -14
- package/src/utils/account.ts +64 -58
- package/src/utils/api.ts +326 -77
- package/src/utils/authSession.ts +24 -0
- package/src/utils/clientIP.ts +213 -0
- package/src/utils/color.ts +279 -0
- package/src/utils/cron.ts +49 -18
- package/src/utils/csv.ts +19 -0
- package/src/utils/datetime.ts +445 -117
- package/src/utils/deferredSave.ts +89 -0
- package/src/utils/email.ts +50 -0
- package/src/utils/emoji.ts +107 -84
- package/src/utils/expression.helpers.ts +470 -0
- package/src/utils/expression.test.ts +793 -0
- package/src/utils/expression.ts +2261 -0
- package/src/utils/interval.ts +80 -0
- package/src/utils/language.ts +9 -0
- package/src/utils/logic.ts +141 -121
- package/src/utils/managedSession.ts +34 -0
- package/src/utils/managedSessionBff.test.ts +60 -0
- package/src/utils/managedSessionBff.ts +117 -0
- package/src/utils/number.ts +85 -38
- package/src/utils/object.ts +227 -30
- package/src/utils/promise.ts +98 -0
- package/src/utils/queryReset.ts +266 -0
- package/src/utils/recurringTask.ts +60 -0
- package/src/utils/schema.ts +293 -0
- package/src/utils/string.test.ts +205 -208
- package/src/utils/string.ts +426 -463
- package/src/utils/timeZone.ts +309 -851
- package/src/utils/url_client.ts +145 -72
- package/tsconfig.json +10 -10
- package/src/constants/billing.ts +0 -146
- package/src/i18n/form.ts +0 -376
- package/src/i18n/product.ts +0 -76
- package/src/types/form.d.ts +0 -97
- package/src/utils/billing.ts +0 -134
package/src/utils/string.test.ts
CHANGED
|
@@ -2,280 +2,277 @@ import { beforeAll, describe, expect, it } from 'vitest';
|
|
|
2
2
|
|
|
3
3
|
import { configI18n } from '../main.ts';
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
5
|
+
addIndefiniteArticle,
|
|
6
|
+
buildSingleText,
|
|
7
|
+
camelCaseToDash,
|
|
8
|
+
cn,
|
|
9
|
+
convertToInternationalPhone,
|
|
10
|
+
escapeCSVValue,
|
|
11
|
+
formatPhoneNumber,
|
|
12
|
+
formatReferenceNumber,
|
|
13
|
+
getAlphanumeric,
|
|
14
|
+
getDisplayName,
|
|
15
|
+
getNthString,
|
|
16
|
+
getSearchNames,
|
|
17
|
+
guessFirstName,
|
|
18
|
+
isEmail,
|
|
19
|
+
isInvisibleString,
|
|
20
|
+
isPhone,
|
|
21
|
+
joinReadable,
|
|
22
|
+
makeAddressText,
|
|
23
|
+
passwordStrength,
|
|
24
|
+
regexFromText,
|
|
25
|
+
removeGeneratedTextGarbage,
|
|
26
|
+
shortenToParagraph,
|
|
27
|
+
shortenToSpace,
|
|
28
|
+
splitTextIntoChunks,
|
|
29
|
+
textWithBrackets,
|
|
30
|
+
truncateFileName,
|
|
31
|
+
ucFirst,
|
|
32
32
|
} from './string.ts';
|
|
33
33
|
|
|
34
34
|
beforeAll(() => {
|
|
35
|
-
|
|
35
|
+
configI18n();
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
describe('cn', () => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
it('joins truthy class names with spaces', () => {
|
|
40
|
+
expect(cn('card', false, 'selected', undefined, null, '')).toBe('card selected');
|
|
41
|
+
});
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
describe('shortenToSpace', () => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
it('shortens at the last available space before the limit', () => {
|
|
46
|
+
expect(shortenToSpace('alpha beta gamma', 12)).toBe('alpha beta...');
|
|
47
|
+
});
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
it('falls back to a hard cut when no spaces exist', () => {
|
|
50
|
+
expect(shortenToSpace('alphabetagamma', 5)).toBe('alpha...');
|
|
51
|
+
});
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
describe('guessFirstName', () => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
it('drops leading articles and returns the first meaningful word', () => {
|
|
56
|
+
expect(guessFirstName('the quick brown fox')).toBe('quick');
|
|
57
|
+
});
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
it('keeps short names instead of stripping the full word as an article suffix', () => {
|
|
60
|
+
expect(guessFirstName('An Lee')).toBe('Lee');
|
|
61
|
+
});
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
describe('addIndefiniteArticle', () => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
it('handles silent-h and consonant-sounding vowel exceptions', () => {
|
|
66
|
+
expect(addIndefiniteArticle('honest answer')).toBe('an honest answer');
|
|
67
|
+
expect(addIndefiniteArticle('user')).toBe('a user');
|
|
68
|
+
});
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
describe('isEmail', () => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
it('accepts trimmed valid emails and rejects malformed values', () => {
|
|
73
|
+
expect(isEmail(' hello@example.com ')).toBe(true);
|
|
74
|
+
expect(isEmail('hello@example')).toBe(false);
|
|
75
|
+
});
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
describe('convertToInternationalPhone and isPhone', () => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
79
|
+
it('normalizes North American and existing international numbers', () => {
|
|
80
|
+
expect(convertToInternationalPhone('(555) 123-4567')).toBe('+15551234567');
|
|
81
|
+
expect(convertToInternationalPhone('+44 20 1234 5678')).toBe('+442012345678');
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('rejects invalid phone-like input', () => {
|
|
85
|
+
expect(convertToInternationalPhone('05551234567')).toBeNull();
|
|
86
|
+
expect(convertToInternationalPhone('555-abc-1234')).toBeNull();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('supports optional conversion when validating phone numbers', () => {
|
|
90
|
+
expect(isPhone('5551234567')).toBe(true);
|
|
91
|
+
expect(isPhone('5551234567', true)).toBe(false);
|
|
92
|
+
expect(isPhone('+442012345678', true)).toBe(true);
|
|
93
|
+
});
|
|
94
94
|
});
|
|
95
95
|
|
|
96
96
|
describe('passwordStrength', () => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
97
|
+
it('reports rule-by-rule password strength details', () => {
|
|
98
|
+
expect(passwordStrength('Abcdef1!')).toEqual({
|
|
99
|
+
valid: true,
|
|
100
|
+
isLongEnough: true,
|
|
101
|
+
hasLowercase: true,
|
|
102
|
+
hasUppercase: true,
|
|
103
|
+
hasDigit: true,
|
|
104
|
+
hasSpecial: true,
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
expect(passwordStrength('abcdefg')).toMatchObject({
|
|
108
|
+
valid: false,
|
|
109
|
+
isLongEnough: false,
|
|
110
|
+
hasLowercase: true,
|
|
111
|
+
hasUppercase: false,
|
|
112
|
+
hasDigit: false,
|
|
113
|
+
hasSpecial: false,
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
116
|
});
|
|
117
117
|
|
|
118
118
|
describe('getAlphanumeric and getSearchNames', () => {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
'Bob',
|
|
128
|
-
'Carol',
|
|
129
|
-
]);
|
|
130
|
-
});
|
|
119
|
+
it('removes punctuation while optionally preserving spaces', () => {
|
|
120
|
+
expect(getAlphanumeric('A-B_C!', false)).toBe('ABC');
|
|
121
|
+
expect(getAlphanumeric('A-B_C!', true)).toBe('ABC');
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('splits mixed delimiters and keeps case-insensitive unique names', () => {
|
|
125
|
+
expect(getSearchNames(['Alice, Bob and alice', 'Carol;\nBob', null])).toEqual(['Alice', 'Bob', 'Carol']);
|
|
126
|
+
});
|
|
131
127
|
});
|
|
132
128
|
|
|
133
129
|
describe('regexFromText', () => {
|
|
134
|
-
|
|
135
|
-
|
|
130
|
+
it('builds a case-insensitive regex from cleaned words', () => {
|
|
131
|
+
const regex = regexFromText('Hello, world!');
|
|
136
132
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
133
|
+
expect(regex).not.toBeNull();
|
|
134
|
+
expect('say hello there'.match(regex!)).toEqual(['hello']);
|
|
135
|
+
expect('WORLD tour'.match(regex!)).toEqual(['WORLD']);
|
|
136
|
+
});
|
|
141
137
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
138
|
+
it('returns null when no searchable words remain', () => {
|
|
139
|
+
expect(regexFromText('a !')).toBeNull();
|
|
140
|
+
});
|
|
145
141
|
});
|
|
146
142
|
|
|
147
143
|
describe('ucFirst and camelCaseToDash', () => {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
144
|
+
it('formats capitalization and dash-separated names', () => {
|
|
145
|
+
expect(ucFirst('marketday')).toBe('Marketday');
|
|
146
|
+
expect(camelCaseToDash('camelCase2Value')).toBe('camel-case-2-value');
|
|
147
|
+
expect(camelCaseToDash('API')).toBe('api');
|
|
148
|
+
});
|
|
153
149
|
});
|
|
154
150
|
|
|
155
151
|
describe('shortenToParagraph', () => {
|
|
156
|
-
|
|
157
|
-
|
|
152
|
+
it('uses paragraph boundaries before falling back to word trimming', () => {
|
|
153
|
+
const text = 'First line\nSecond line\nThird line';
|
|
158
154
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
155
|
+
expect(shortenToParagraph(text, 18)).toBe('First line');
|
|
156
|
+
expect(shortenToParagraph('Alpha beta gamma', 10)).toBe('Alpha...');
|
|
157
|
+
});
|
|
162
158
|
});
|
|
163
159
|
|
|
164
160
|
describe('isInvisibleString', () => {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
161
|
+
it('detects strings made only from whitespace-like invisible characters', () => {
|
|
162
|
+
expect(isInvisibleString('ㅤ️⠀')).toBe(true);
|
|
163
|
+
expect(isInvisibleString(' visible ')).toBe(false);
|
|
164
|
+
});
|
|
169
165
|
});
|
|
170
166
|
|
|
171
167
|
describe('buildSingleText', () => {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
168
|
+
it('renders ternary arrays and nested sections with the selected delimiter', () => {
|
|
169
|
+
for (const preCheck of [true, false]) {
|
|
170
|
+
expect(
|
|
171
|
+
buildSingleText(
|
|
172
|
+
['Header', '', !preCheck ? ['Summary', '', ['Details', { extra: ['Extra details'] }]] : '', '', 'Footer'],
|
|
173
|
+
'|',
|
|
174
|
+
['extra'],
|
|
175
|
+
),
|
|
176
|
+
).toBe(preCheck ? 'Header||Footer' : 'Header||Summary||Details|Extra details||Footer');
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it('supports feature maps, conditional lines, first-match groups, and blank line collapsing', () => {
|
|
181
|
+
expect(
|
|
182
|
+
buildSingleText(
|
|
183
|
+
[
|
|
184
|
+
'Header',
|
|
185
|
+
'',
|
|
186
|
+
'',
|
|
187
|
+
{ advanced: ['Advanced section'] },
|
|
188
|
+
[['beta', '!legacy'], ['Beta only']],
|
|
189
|
+
[
|
|
190
|
+
[['admin'], ['Admin choice']],
|
|
191
|
+
[['member'], [' Member choice']],
|
|
192
|
+
[['!member'], ['Fallback choice']],
|
|
193
|
+
],
|
|
194
|
+
'Footer',
|
|
195
|
+
],
|
|
196
|
+
'\n',
|
|
197
|
+
['advanced', 'beta', 'member'],
|
|
198
|
+
),
|
|
199
|
+
).toBe('Header\n\nAdvanced section\nBeta only\nMember choice\nFooter');
|
|
200
|
+
});
|
|
193
201
|
});
|
|
194
202
|
|
|
195
203
|
describe('joinReadable and textWithBrackets', () => {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
204
|
+
it('joins human-readable lists and appends bracket text when present', () => {
|
|
205
|
+
expect(joinReadable(['Alpha', 'Beta', 'Gamma'])).toBe('Alpha, Beta and Gamma');
|
|
206
|
+
expect(textWithBrackets('Status', ['draft', 'internal'], ['[', ']'])).toBe('Status [draft internal]');
|
|
207
|
+
expect(textWithBrackets('', ['draft', 'internal'], ['[', ']'])).toBe('draft internal');
|
|
208
|
+
});
|
|
201
209
|
});
|
|
202
210
|
|
|
203
211
|
describe('removeGeneratedTextGarbage and escapeCSVValue', () => {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
212
|
+
it('normalizes generated whitespace and escapes CSV-sensitive values', () => {
|
|
213
|
+
expect(removeGeneratedTextGarbage('Hello\n\n world\tfrom\r\nAI')).toBe('Hello world from AI');
|
|
214
|
+
expect(escapeCSVValue('plain')).toBe('plain');
|
|
215
|
+
expect(escapeCSVValue('a,"b"\nc')).toBe('"a,""b""\nc"');
|
|
216
|
+
});
|
|
209
217
|
});
|
|
210
218
|
|
|
211
219
|
describe('truncateFileName', () => {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
220
|
+
it('preserves extensions while truncating long file names', () => {
|
|
221
|
+
expect(truncateFileName('very-long-document-name.pdf', 12)).toBe('very-....pdf');
|
|
222
|
+
expect(truncateFileName('short.txt', 20)).toBe('short.txt');
|
|
223
|
+
});
|
|
216
224
|
});
|
|
217
225
|
|
|
218
226
|
describe('formatPhoneNumber', () => {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
227
|
+
it('formats trailing 10 digits into a readable North American phone number', () => {
|
|
228
|
+
expect(formatPhoneNumber('+15551234567')).toBe('+1 (555) 123-4567');
|
|
229
|
+
expect(formatPhoneNumber('5551234567')).toBe('(555) 123-4567');
|
|
230
|
+
expect(formatPhoneNumber('not-a-phone')).toBe('not-a-phone');
|
|
231
|
+
});
|
|
224
232
|
});
|
|
225
233
|
|
|
226
234
|
describe('splitTextIntoChunks', () => {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
it('falls back to whitespace boundaries when no line break is nearby', () => {
|
|
236
|
-
expect(splitTextIntoChunks('alpha beta gamma delta', 12, 2)).toEqual([
|
|
237
|
-
'alpha beta',
|
|
238
|
-
'gamma delta',
|
|
239
|
-
]);
|
|
240
|
-
});
|
|
235
|
+
it('prefers nearby line breaks when splitting long text', () => {
|
|
236
|
+
expect(splitTextIntoChunks('12345\n67890\nabcde', 10, 5)).toEqual(['12345', '67890', 'abcde']);
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
it('falls back to whitespace boundaries when no line break is nearby', () => {
|
|
240
|
+
expect(splitTextIntoChunks('alpha beta gamma delta', 12, 2)).toEqual(['alpha beta', 'gamma delta']);
|
|
241
|
+
});
|
|
241
242
|
});
|
|
242
243
|
|
|
243
244
|
describe('formatReferenceNumber and getNthString', () => {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
245
|
+
it('formats numeric references and ordinal suffixes', () => {
|
|
246
|
+
expect(formatReferenceNumber('42')).toBe('#42');
|
|
247
|
+
expect(formatReferenceNumber('abc')).toBe('abc');
|
|
248
|
+
expect(getNthString(1)).toBe('1st');
|
|
249
|
+
expect(getNthString(2)).toBe('2nd');
|
|
250
|
+
expect(getNthString(3)).toBe('3rd');
|
|
251
|
+
expect(getNthString(11)).toBe('11th');
|
|
252
|
+
expect(getNthString(23)).toBe('23rd');
|
|
253
|
+
});
|
|
253
254
|
});
|
|
254
255
|
|
|
255
256
|
describe('makeAddressText and getDisplayName', () => {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
fullName: 'John Smith',
|
|
278
|
-
displayName: 'John',
|
|
279
|
-
});
|
|
280
|
-
});
|
|
257
|
+
it('formats addresses in each supported display mode', () => {
|
|
258
|
+
const address = {
|
|
259
|
+
line1: '1 Main St',
|
|
260
|
+
line2: 'Suite 2',
|
|
261
|
+
city: 'Toronto',
|
|
262
|
+
state: 'ON',
|
|
263
|
+
postalCode: 'A1A 1A1',
|
|
264
|
+
country: 'CA',
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
expect(makeAddressText(address, 'REGION_ONLY')).toBe('Toronto, ON, CA');
|
|
268
|
+
expect(makeAddressText(address, 'SINGLE_LINE', true)).toBe('1 Main St, Suite 2, Toronto, ON, A1A 1A1, Canada');
|
|
269
|
+
expect(makeAddressText(address)).toBe('1 Main St\nSuite 2\nToronto, ON A1A 1A1\nCA');
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
it('builds a full name and short display name together', () => {
|
|
273
|
+
expect(getDisplayName('John', 'Smith')).toEqual({
|
|
274
|
+
fullName: 'John Smith',
|
|
275
|
+
displayName: 'John',
|
|
276
|
+
});
|
|
277
|
+
});
|
|
281
278
|
});
|