blob: 6e5edaec16489ef0be8c41d9982d6cdf44c101c4 [file] [log] [blame]
Adrià Vilanova Martínezac4a6442022-05-15 19:05:13 +02001// Copyright 2021 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5import {assert, expect} from 'chai';
6import {expandDescriptions} from 'react/issue-wizard/IssueWizardDescriptionsUtils.tsx';
7
8describe('IssueWizardDescriptionsUtils', () => {
9 it('get expandDescription and labels', () => {
10 const {expandDescription, expandLabels} = expandDescriptions(
11 'Network / Downloading',
12 ['test url'],
13 false,
14 'test',
15 [],
16 )
17 assert.equal(expandLabels.length, 1);
18 expect(expandDescription).to.contain("test url");
19 });
20
21 it('get proper component value base on user answer', () => {
22 const {expandDescription, expandLabels, compVal} = expandDescriptions(
23 'Content',
24 ['test url', 'LABELS: Yes - this is'],
25 false,
26 'test',
27 [],
28 )
29 assert.equal(expandLabels.length, 1);
30 assert.equal(expandLabels[0].label, 'Type-Bug');
31 assert.equal(compVal, 'Blink');
32 expect(expandDescription).to.contain("test url");
33 });
34});