@carbon/ibm-cloud-cognitive-cdai
Version:
Carbon for Cloud & Cognitive CD&AI UI components
27 lines (26 loc) • 1.11 kB
JavaScript
//
// Copyright IBM Corp. 2020, 2020
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//
import * as jth from '../../component_helpers/jest_test_helper_functions.js';
import { IdeAPIKeyGeneration } from '.';
describe('IdeAPIKeyGeneration unit tests', function () {
var component, unmount;
var mountTestComponent = function mountTestComponent() {
var defaultProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var test = jth.mountComponent(jth.getJSXForComponent(IdeAPIKeyGeneration, defaultProps, props));
component = test.component;
unmount = test.unmount;
};
afterEach(function () {
// if unmount defined, call it to clear up any mounted component
unmount && unmount();
});
it('IdeAPIKeyGeneration tolerates no props being provided, and renders with defaults', function () {
mountTestComponent();
expect(component.getElements()).toMatchSnapshot();
});
});