blob: 7b2932b23af7d900282f9daae7ec7e39074a7fee [file] [log] [blame]
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import {assert, expect} from 'chai';
import {expandDescriptions} from 'react/issue-wizard/IssueWizardDescriptionsUtils.tsx';
describe('IssueWizardDescriptionsUtils', () => {
it('get expandDescription and labels', () => {
const {expandDescription, expandLabels} = expandDescriptions(
'Network / Downloading',
['test url'],
false,
'test',
[],
)
assert.equal(expandLabels.length, 1);
expect(expandDescription).to.contain("test url");
});
it('get proper component value base on user answer', () => {
const {expandDescription, expandLabels, compVal} = expandDescriptions(
'Content',
['test url', 'LABELS: Yes - this is'],
false,
'test',
[],
)
assert.equal(expandLabels.length, 1);
assert.equal(expandLabels[0].label, 'Type-Bug');
assert.equal(compVal, 'Blink');
expect(expandDescription).to.contain("test url");
});
});