Skip to content
Snippets Groups Projects
Select Git revision
  • 85114e23f41a9e801dd468bf3e751ea1fe505a47
  • main default protected
  • 24-everything-from-git
  • 45-create-new-poc-deployment-with-docker
  • 44-add-a-cli-tool
  • improve-deployment
  • 31-backend
  • bash-script-bug-fix
  • upgrades_submodules
  • 24-dependencies-build-nested-watch
  • 24-dependencies-build-using-workspaces
  • 24-dependencies-build
  • wip-all-local
  • 10-annotot
  • 3-annotation-plugin-showing-up
15 results

webpack.config.js

Blame
  • SanitizedHtml.test.js 788 B
    import React from 'react';
    import { shallow } from 'enzyme';
    import SanitizedHtml from '../../../src/components/SanitizedHtml';
    
    const wrapper = shallow(
      <SanitizedHtml
        htmlString="<script>doBadThings()</script><b>Don't worry!</b>"
        ruleSet="basic"
      />,
    );
    
    describe('SanitizedHtml', () => {
      it('should render needed elements', () => {
        expect(wrapper.find('span').length).toBe(1);
      });
    
      it('should pass correct class name to root element', () => {
        expect(wrapper.find('span').first().props().className).toBe('mirador-third-party-html');
      });
    
      it('should pass sanitized html string to dangerouslySetInnerHTML attribute', () => {
        expect(wrapper.find('span').first().props().dangerouslySetInnerHTML)
          .toEqual({ __html: "<b>Don't worry!</b>" });
      });
    });