import { OpenSheetMusicDisplay } from "../../src/OpenSheetMusicDisplay/OpenSheetMusicDisplay" ; /**
 * This class collects useful methods to interact with test data.
 * During tests, XML and MXL documents are preprocessed by karma,
 * and this is some helper code to retrieve them.
 */ export class TestUtils { public static getScore ( name ) { const path = "test/data/" + name ; return ( ( window as any ) . __xml__ ) [ path ] ; } public static getMXL ( scoreName ) { const path = "test/data/" + scoreName ; return ( ( window as any ) . __raw__ ) [ path ] ; } public static getDivElement ( document ) { const div = document . createElement ( "div" ) ; const body = document . getElementsByTagName ( "body" ) [ 0 ] ; body . appendChild ( div ) ; return div ; } param doc returns { Element } public static getPartWiseElement ( doc ) { const nodes = doc . childNodes ; for ( let i = 0 , length = nodes . length ; i < length ; i += 1 ) { const node = nodes [ i ] ; if ( node . nodeType === Node . ELEMENT_NODE && node . nodeName . toLowerCase ( ) === "score-partwise" ) { return < Element > node ; } } } public static createOpenSheetMusicDisplay ( div ) { return new OpenSheetMusicDisplay ( div , { autoResize : false } ) ; } }