textbox.test.jsx.snap 10.1 KB
Newer Older
1
2
3
4
5
6
7
8
9
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`components/TextBox should match snapshot with required props 1`] = `
<div
  className="textarea-wrapper"
>
  <SuggestionBox
    className="form-control custom-textarea"
    completeOnTab={true}
10
    containerClass=""
11
12
13
14
15
16
17
18
19
20
21
    id="someid"
    inputComponent={[Function]}
    isRHS={false}
    listComponent={[Function]}
    listStyle="top"
    onBlur={[Function]}
    onChange={[Function]}
    onHeightChange={[Function]}
    onKeyDown={[Function]}
    onKeyPress={[Function]}
    openOnFocus={false}
22
    openWhenEmpty={false}
23
24
25
26
    placeholder="placeholder text"
    providers={
      Array [
        AtMentionProvider {
27
          "autocompleteUsersInChannel": [Function],
28
29
          "currentUserId": "currentUserId",
          "data": null,
30
31
32
          "disableDispatches": false,
          "latestComplete": true,
          "latestPrefix": "",
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
          "profilesInChannel": Array [
            Object {
              "id": "id1",
            },
            Object {
              "id": "id2",
            },
          ],
          "profilesNotInChannel": Array [
            Object {
              "id": "id3",
            },
            Object {
              "id": "id4",
            },
          ],
49
          "requestStarted": false,
50
51
52
53
        },
        ChannelMentionProvider {
          "disableDispatches": false,
          "lastCompletedWord": "",
54
          "lastPrefixTrimmed": "",
55
56
57
          "lastPrefixWithNoResults": "",
          "latestComplete": true,
          "latestPrefix": "",
58
          "requestStarted": false,
59
60
61
62
63
        },
        EmoticonProvider {},
      ]
    }
    renderDividers={true}
64
65
    renderNoResults={false}
    replaceAllInputOnSelect={false}
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
    requiredCharacters={1}
    spellCheck="true"
    style={
      Object {
        "visibility": "visible",
      }
    }
    value="some test text"
  />
  <div
    className="help__text "
  >
    <div
      className="help__format-text"
      id="helpText"
      style={
        Object {
          "opacity": "0.45",
          "visibility": "visible",
        }
      }
    >
      <b>
        <FormattedMessage
          defaultMessage="**bold**"
          id="textbox.bold"
          values={Object {}}
        />
      </b>
      <i>
        <FormattedMessage
          defaultMessage="_italic_"
          id="textbox.italic"
          values={Object {}}
        />
      </i>
      <span>
        ~~
        <strike>
          <FormattedMessage
            defaultMessage="strike"
            id="textbox.strike"
            values={Object {}}
          />
        </strike>
        ~~ 
      </span>
      <span>
        <FormattedMessage
          defaultMessage="\`inline code\`"
          id="textbox.inlinecode"
          values={Object {}}
        />
      </span>
      <span>
        <FormattedMessage
          defaultMessage="\`\`\`preformatted\`\`\`"
          id="textbox.preformatted"
          values={Object {}}
        />
      </span>
      <span>
        <FormattedMessage
          defaultMessage=">quote"
          id="textbox.quote"
          values={Object {}}
        />
      </span>
    </div>
135
    <Link
136
137
138
      className="textbox-help-link"
      id="helpTextLink"
      rel="noopener noreferrer"
139
      replace={false}
140
      target="_blank"
141
      to="/help/messaging"
142
143
144
145
146
147
    >
      <FormattedMessage
        defaultMessage="Help"
        id="textbox.help"
        values={Object {}}
      />
148
    </Link>
149
150
151
152
  </div>
</div>
`;

153
154
155
156
157
158
159
exports[`components/TextBox should throw error when new property is too long 1`] = `
<div
  className="textarea-wrapper"
>
  <SuggestionBox
    className="form-control custom-textarea"
    completeOnTab={true}
160
    containerClass=""
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
    id="someid"
    inputComponent={[Function]}
    isRHS={false}
    listComponent={[Function]}
    listStyle="top"
    onBlur={[Function]}
    onChange={[Function]}
    onHeightChange={[Function]}
    onKeyDown={[Function]}
    onKeyPress={[Function]}
    openOnFocus={false}
    openWhenEmpty={false}
    placeholder="placeholder text"
    providers={
      Array [
        AtMentionProvider {
177
          "autocompleteUsersInChannel": [Function],
178
179
          "currentUserId": "currentUserId",
          "data": null,
180
181
182
          "disableDispatches": false,
          "latestComplete": true,
          "latestPrefix": "",
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
          "profilesInChannel": Array [
            Object {
              "id": "id1",
            },
            Object {
              "id": "id2",
            },
          ],
          "profilesNotInChannel": Array [
            Object {
              "id": "id3",
            },
            Object {
              "id": "id4",
            },
          ],
199
          "requestStarted": false,
200
201
202
203
        },
        ChannelMentionProvider {
          "disableDispatches": false,
          "lastCompletedWord": "",
204
          "lastPrefixTrimmed": "",
205
206
207
          "lastPrefixWithNoResults": "",
          "latestComplete": true,
          "latestPrefix": "",
208
          "requestStarted": false,
209
210
211
212
213
        },
        EmoticonProvider {},
      ]
    }
    renderDividers={true}
214
215
    renderNoResults={false}
    replaceAllInputOnSelect={false}
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
    requiredCharacters={1}
    spellCheck="true"
    style={
      Object {
        "visibility": "visible",
      }
    }
    value="some test text that exceeds char limit"
  />
  <div
    className="help__text hidden"
  >
    <div
      className="help__format-text"
      id="helpText"
      style={
        Object {
          "opacity": "0.45",
          "visibility": "visible",
        }
      }
    >
      <b>
        <FormattedMessage
          defaultMessage="**bold**"
          id="textbox.bold"
          values={Object {}}
        />
      </b>
      <i>
        <FormattedMessage
          defaultMessage="_italic_"
          id="textbox.italic"
          values={Object {}}
        />
      </i>
      <span>
        ~~
        <strike>
          <FormattedMessage
            defaultMessage="strike"
            id="textbox.strike"
            values={Object {}}
          />
        </strike>
        ~~ 
      </span>
      <span>
        <FormattedMessage
          defaultMessage="\`inline code\`"
          id="textbox.inlinecode"
          values={Object {}}
        />
      </span>
      <span>
        <FormattedMessage
          defaultMessage="\`\`\`preformatted\`\`\`"
          id="textbox.preformatted"
          values={Object {}}
        />
      </span>
      <span>
        <FormattedMessage
          defaultMessage=">quote"
          id="textbox.quote"
          values={Object {}}
        />
      </span>
    </div>
285
    <Link
286
287
288
      className="textbox-help-link"
      id="helpTextLink"
      rel="noopener noreferrer"
289
      replace={false}
290
      target="_blank"
291
      to="/help/messaging"
292
293
294
295
296
297
    >
      <FormattedMessage
        defaultMessage="Help"
        id="textbox.help"
        values={Object {}}
      />
298
    </Link>
299
300
301
302
  </div>
</div>
`;

303
304
305
306
307
308
309
exports[`components/TextBox should throw error when value is too long 1`] = `
<div
  className="textarea-wrapper"
>
  <SuggestionBox
    className="form-control custom-textarea"
    completeOnTab={true}
310
    containerClass=""
311
312
313
314
315
316
317
318
319
320
321
    id="someid"
    inputComponent={[Function]}
    isRHS={false}
    listComponent={[Function]}
    listStyle="top"
    onBlur={[Function]}
    onChange={[Function]}
    onHeightChange={[Function]}
    onKeyDown={[Function]}
    onKeyPress={[Function]}
    openOnFocus={false}
322
    openWhenEmpty={false}
323
324
325
326
    placeholder="placeholder text"
    providers={
      Array [
        AtMentionProvider {
327
          "autocompleteUsersInChannel": [Function],
328
329
          "currentUserId": "currentUserId",
          "data": null,
330
331
332
          "disableDispatches": false,
          "latestComplete": true,
          "latestPrefix": "",
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
          "profilesInChannel": Array [
            Object {
              "id": "id1",
            },
            Object {
              "id": "id2",
            },
          ],
          "profilesNotInChannel": Array [
            Object {
              "id": "id3",
            },
            Object {
              "id": "id4",
            },
          ],
349
          "requestStarted": false,
350
351
352
353
        },
        ChannelMentionProvider {
          "disableDispatches": false,
          "lastCompletedWord": "",
354
          "lastPrefixTrimmed": "",
355
356
357
          "lastPrefixWithNoResults": "",
          "latestComplete": true,
          "latestPrefix": "",
358
          "requestStarted": false,
359
360
361
362
363
        },
        EmoticonProvider {},
      ]
    }
    renderDividers={true}
364
365
    renderNoResults={false}
    replaceAllInputOnSelect={false}
366
367
368
369
370
371
372
    requiredCharacters={1}
    spellCheck="true"
    style={
      Object {
        "visibility": "visible",
      }
    }
373
    value="some test text that exceeds char limit"
374
375
  />
  <div
376
    className="help__text hidden"
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
  >
    <div
      className="help__format-text"
      id="helpText"
      style={
        Object {
          "opacity": "0.45",
          "visibility": "visible",
        }
      }
    >
      <b>
        <FormattedMessage
          defaultMessage="**bold**"
          id="textbox.bold"
          values={Object {}}
        />
      </b>
      <i>
        <FormattedMessage
          defaultMessage="_italic_"
          id="textbox.italic"
          values={Object {}}
        />
      </i>
      <span>
        ~~
        <strike>
          <FormattedMessage
            defaultMessage="strike"
            id="textbox.strike"
            values={Object {}}
          />
        </strike>
        ~~ 
      </span>
      <span>
        <FormattedMessage
          defaultMessage="\`inline code\`"
          id="textbox.inlinecode"
          values={Object {}}
        />
      </span>
      <span>
        <FormattedMessage
          defaultMessage="\`\`\`preformatted\`\`\`"
          id="textbox.preformatted"
          values={Object {}}
        />
      </span>
      <span>
        <FormattedMessage
          defaultMessage=">quote"
          id="textbox.quote"
          values={Object {}}
        />
      </span>
    </div>
435
    <Link
436
437
438
      className="textbox-help-link"
      id="helpTextLink"
      rel="noopener noreferrer"
439
      replace={false}
440
      target="_blank"
441
      to="/help/messaging"
442
443
444
445
446
447
    >
      <FormattedMessage
        defaultMessage="Help"
        id="textbox.help"
        values={Object {}}
      />
448
    </Link>
449
450
451
  </div>
</div>
`;