123456789101112131415161718192021222324252627282930313233343536373839 |
- // Copyright (c) Jupyter Development Team.
- import 'jest';
- import * as fs from 'fs';
- import * as path from 'path';
- import { LabIcon } from '@jupyterlab/ui-components';
- const fooSvgstr = fs.readFileSync(path.join(__dirname, 'foo.svg'), {
- encoding: 'utf8'
- });
- const fooIcon = new LabIcon({
- name: 'test-ui-components:foo',
- svgstr: fooSvgstr
- });
- describe('@jupyterlab/ui-components', () => {
- describe('svg import', () => {
- it('should hold a string with the raw contents of an svg', () => {
- expect(
- fooSvgstr.startsWith(`<svg width="24" height="24" viewBox="0 0 24 24"`)
- ).toBe(true);
- });
- });
- describe('LabIcon', () => {
- describe('attribute .svgstr', () => {
- it('should hold a string with the raw contents of an svg', () => {
- expect(
- fooIcon.svgstr.startsWith(
- `<svg width="24" height="24" viewBox="0 0 24 24"`
- )
- ).toBe(true);
- });
- });
- });
- });
|