SVG的Mocha测试

时间:2018-08-31 08:07:37

标签: javascript unit-testing testing polymer

我对测试完全陌生。只是想使用聚合物3为我的svg元素编写测试。我的代码看起来像打击

import {LitElement, html} from '@polymer/lit-element';

export class CDSCEMark extends LitElement {
  render() {
    return html`
      <style>
        :host {
          height: 2.5rem;
          display: flex;
          align-self: flex-end;
        }

        svg {
          width: auto;
          height: 100%;
          display: block;
        }
      </style>
      <svg viewbox="0 0 280 200" preserveaspectratio="xMinYMin meet" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;">
          <path d="M110,199.498744A100,100 0 0 1 100,200A100,100 0 0 1 100,0A100,100 0 0 1 110,0.501256L110,30.501256A70,70 0 0 0 100,30A70,70 0 0 0 100,170A70,70 0 0 0 110,169.498744Z" fill="black"/>
          <path d="M280,199.498744A100,100 0 0 1 270,200A100,100 0 0 1 270,0A100,100 0 0 1 280,0.501256L280,30.501256A70,70 0 0 0 270,30A70,70 0 0 0 201.620283,85L260,85L260,115L201.620283,115A70,70 0 0 0 270,170A70,70 0 0 0 280,169.498744Z" fill="black"/>
      </svg>
    `;
  }
}

customElements.define('cds-ce-mark', CDSCEMark);

0 个答案:

没有答案