ima-ui-atoms
Version:
IMA.js UI React atoms
80 lines (76 loc) • 2.91 kB
JavaScript
;
var UIAtoms = _interopRequireWildcard(require("../main"));
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
describe('UIAtoms', () => {
it('should have the headline component', () => {
expect(UIAtoms.Headline).not.toEqual(null);
});
it('should have the headline1 component', () => {
expect(UIAtoms.Headline1).not.toEqual(null);
});
it('should have the headline1 alias as H1', () => {
expect(UIAtoms.H1).not.toEqual(null);
});
it('should have the image component', () => {
expect(UIAtoms.Image).not.toEqual(null);
});
it('should have the image alias as img', () => {
expect(UIAtoms.Img).not.toEqual(null);
});
it('should have the iframe component', () => {
expect(UIAtoms.Iframe).not.toEqual(null);
});
it('should have the link component', () => {
expect(UIAtoms.Link).not.toEqual(null);
});
it('should have the link alias as A', () => {
expect(UIAtoms.A).not.toEqual(null);
});
it('should have the loader component', () => {
expect(UIAtoms.Loader).not.toEqual(null);
});
it('should have the sizer component', () => {
expect(UIAtoms.Sizer).not.toEqual(null);
});
it('should have the paragraph component', () => {
expect(UIAtoms.Paragraph).not.toEqual(null);
});
it('should have the paragraph alias as P', () => {
expect(UIAtoms.P).not.toEqual(null);
});
it('should have the list component', () => {
expect(UIAtoms.List).not.toEqual(null);
});
it('should have the unordered list component', () => {
expect(UIAtoms.UnorderedList).not.toEqual(null);
});
it('should have the unordered list alias as ul', () => {
expect(UIAtoms.Ul).not.toEqual(null);
});
it('should have the listItem component', () => {
expect(UIAtoms.ListItem).not.toEqual(null);
});
it('should have the listItem alias as Li', () => {
expect(UIAtoms.Li).not.toEqual(null);
});
it('should have the video component', () => {
expect(UIAtoms.Video).not.toEqual(null);
});
it('should call $registerImaPlugin method without throwing error', () => {
let mockNs = {
namespace: namespace => {
let parts = namespace.split('.');
let namespacePart = mockNs;
parts.forEach(part => {
if (!namespacePart[part]) {
namespacePart[part] = {};
}
namespacePart = namespacePart[part];
});
}
};
expect(() => {
UIAtoms.$registerImaPlugin(mockNs);
}).not.toThrow();
});
});