https://github.com/hms-dbmi/higlass
Raw File
Tip revision: 335f4eea6445d07baa5eda2e66077dca461b7777 authored by Sehi L'Yi on 17 January 2024, 20:19:11 UTC
update changelog (#1192)
Tip revision: 335f4ee
LocalTileFetcherTests.js
// @ts-nocheck
/* eslint-env mocha */
import Enzyme from 'enzyme';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
import { expect } from 'chai';

import viewconf from './view-configs-more/local-tiles-viewconf.json';
// Utils
import {
  mountHGComponent,
  removeHGComponent,
} from '../app/scripts/test-helpers';
import { getTrackObjectFromHGC } from '../app/scripts/utils';

Enzyme.configure({ adapter: new Adapter() });

describe('Local Tile Fetcher', () => {
  let hgc = null;

  let div = null;

  before((done) => {
    [div, hgc] = mountHGComponent(div, hgc, viewconf, done, {
      style: 'width:600px; height:400px; background-color: lightgreen',
      bounded: true,
    });
  });

  it('should get the gene annotation track', () => {
    const trackObj = getTrackObjectFromHGC(hgc.instance(), 'vv', 'tt');

    expect(trackObj.allTexts.length).to.be.above(0);
    expect(trackObj.allTexts[0].caption).to.eql('SEMA3A');
  });

  it('should get the bar track', () => {
    const trackObj = getTrackObjectFromHGC(hgc.instance(), 'vv', 'ss');

    expect(
      Object.values(trackObj.fetchedTiles).every((tile) => tile.svgData),
    ).to.eql(true);

    expect(trackObj.zeroLine.fill.alpha).to.eql(1);
  });

  after(() => {
    removeHGComponent(div);
  });
});
back to top