// 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");
  });
});
