Adrià Vilanova MartÃnez | ac4a644 | 2022-05-15 19:05:13 +0200 | [diff] [blame^] | 1 | // 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 | |
| 5 | import {assert, expect} from 'chai'; |
| 6 | import {expandDescriptions} from 'react/issue-wizard/IssueWizardDescriptionsUtils.tsx'; |
| 7 | |
| 8 | describe('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 | }); |