blob: 7b2932b23af7d900282f9daae7ec7e39074a7fee [file] [log] [blame]
Adrià Vilanova Martínezf19ea432024-01-23 20:20:52 +01001// Copyright 2021 The Chromium Authors
Adrià Vilanova Martínezac4a6442022-05-15 19:05:13 +02002// 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});