vendredi 31 août 2018

Mocha test for svg

I am totally new to testing. Just want to write a test for my svg element using polymer 3. My code looks like blow

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);

Aucun commentaire:

Enregistrer un commentaire