UNPKG

@carbon/ibm-cloud-cognitive-cdai

Version:
20 lines (19 loc) 663 B
// // 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 IDHelper from './IDHelper'; describe('IDHelper', function () { it('idAttribute() returns the expected output for an identiifer', function () { var input = 'foo'; expect(IDHelper.idAttribute(input)).toEqual({ 'data-ui-id': input }); }); it('idAttributeSelector() returns the selector for a given identifier', function () { var input = 'bar'; expect(IDHelper.idAttributeSelector(input)).toEqual("[data-ui-id=\"".concat(input, "\"]")); }); });