How to use DAGService method in tracetest

Best JavaScript code snippet using tracetest

dag.component.ts

Source:dag.component.ts Github

copy

Full Screen

1/*2 * Copyright 2017 OICR3 *4 * Licensed under the Apache License, Version 2.0 (the 'License');5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 *8 * http://www.apache.org/licenses/LICENSE-2.09 *10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an 'AS IS' BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */16import { AfterViewInit, Component, ElementRef, HostListener, Input, NgZone, OnChanges, OnInit, ViewChild } from '@angular/core';17import { filterNil } from '@datorama/akita';18import { BioWorkflow } from 'app/shared/swagger/model/bioWorkflow';19import { Observable } from 'rxjs';20import { takeUntil } from 'rxjs/operators';21import { Dockstore } from '../../shared/dockstore.model';22import { EntryTab } from '../../shared/entry/entry-tab';23import { SessionQuery } from '../../shared/session/session.query';24import { WorkflowQuery } from '../../shared/state/workflow.query';25import { ToolDescriptor } from '../../shared/swagger';26import { WorkflowVersion } from './../../shared/swagger/model/workflowVersion';27import { DagQuery } from './state/dag.query';28import { DagService } from './state/dag.service';29import { DagStore } from './state/dag.store';30import { WdlViewerService } from './wdl-viewer/state/wdl-viewer.service';31import { WdlViewerComponent } from './wdl-viewer/wdl-viewer.component';32/**33 * This is the DAG tab34 * TODO: Not have a fixed 500px normal sized DAG in case people are using different height screens35 * TODO: Material tooltips to appear in fullscreen mode.36 * The matTooltip DOM is in a seperate div than the fullscreen element's div, that's why it doesn't show37 * TODO: Performance improvements38 * @export39 * @class DagComponent40 * @extends {EntryTab}41 * @implements {OnInit}42 * @implements {OnChanges}43 */44@Component({45 selector: 'app-dag',46 templateUrl: './dag.component.html',47 styleUrls: ['./dag.component.scss'],48 providers: [DagStore, DagQuery, DagService, WdlViewerService]49})50export class DagComponent extends EntryTab implements OnInit, OnChanges, AfterViewInit {51 @Input() id: number;52 @Input() selectedVersion: WorkflowVersion;53 @ViewChild('exportLink', { static: false }) exportLink: ElementRef;54 @ViewChild('cy', { static: false }) cyElement: ElementRef;55 @ViewChild(WdlViewerComponent, { static: false }) wdlViewer: WdlViewerComponent;56 @ViewChild('dagHolder', { static: true }) dagHolderElement: ElementRef;57 public dagResult$: Observable<any>;58 private cy: cytoscape.Core;59 public expanded: Boolean = false;60 public workflow$: Observable<BioWorkflow>;61 public isNFL$: Observable<boolean>;62 public isWDL$: Observable<boolean>;63 public descriptorType$: Observable<ToolDescriptor.TypeEnum>;64 public missingTool$: Observable<boolean>;65 public dagType: 'classic' | 'cwlviewer' | 'wdlviewer' = 'classic';66 public enableCwlViewer = Dockstore.FEATURES.enableCwlViewer;67 ToolDescriptor = ToolDescriptor;68 public refreshCounter = 1;69 public dagLoading$: Observable<boolean>;70 public wdlViewerResult$: Observable<boolean>;71 public isPublic$: Observable<boolean>;72 /**73 * Listen to when the document enters or exits fullscreen.74 * Refreshes cytoscape because it is not centered. Set styling based on whether it's fullscreen or not.75 *76 * @param {KeyboardEvent} event77 * @memberof DagComponent78 */79 @HostListener('document:fullscreenchange', ['$event'])80 FSHandler(event: KeyboardEvent) {81 // expanded is used for HTML styling and depends solely on whether the screen is actually fullscreen or not82 this.expanded = this.dagService.isFullScreen();83 this.refreshDocument(this.cy);84 }85 reset() {86 switch (this.dagType) {87 case 'wdlviewer':88 this.wdlViewer.reset();89 break;90 default:91 this.refreshCounter++;92 this.refreshDocument(this.cy);93 break;94 }95 }96 constructor(97 private dagService: DagService,98 private workflowQuery: WorkflowQuery,99 private dagQuery: DagQuery,100 private ngZone: NgZone,101 private sessionQuery: SessionQuery,102 private wdlViewerService: WdlViewerService103 ) {104 super();105 }106 /**107 * For some reason the cy element is not guaranteed to be visible and ready when ngAfterViewinit is called.108 * Was using window.requestAnimationFrame() before, but now using https://github.com/angular/angular/issues/8804 for performance109 * Still could use more performance optimizations110 *111 * @memberof DagComponent112 */113 refreshDocument(cy: cytoscape.Core) {114 if (this.cyElement && this.cyElement.nativeElement.offsetHeight >= 500) {115 this.ngZone.runOutsideAngular(() =>116 requestAnimationFrame(() => {117 this.cy = this.dagService.refreshDocument(cy, this.cyElement.nativeElement);118 })119 );120 } else {121 requestAnimationFrame(() => this.refreshDocument(cy));122 }123 }124 toggleExpand() {125 if (this.expanded) {126 this.dagService.closeFullscreen();127 } else {128 const nativeElement: HTMLElement | any = this.dagHolderElement.nativeElement;129 this.dagService.openFullscreen(nativeElement);130 }131 }132 ngOnInit() {133 this.dagLoading$ = this.dagQuery.selectLoading();134 this.descriptorType$ = this.workflowQuery.descriptorType$;135 this.isNFL$ = this.workflowQuery.isNFL$;136 this.isWDL$ = this.workflowQuery.isWDL$;137 this.dagResult$ = this.dagQuery.dagResults$;138 this.workflow$ = <Observable<BioWorkflow>>this.workflowQuery.workflow$;139 this.missingTool$ = this.dagQuery.missingTool$;140 this.dagService.loadExtensions();141 this.wdlViewerResult$ = this.wdlViewerService.status$;142 this.isPublic$ = this.sessionQuery.isPublic$;143 }144 ngAfterViewInit(): void {145 this.dagResult$146 .pipe(147 filterNil,148 takeUntil(this.ngUnsubscribe)149 )150 .subscribe(151 dagResults => {152 this.refreshDocument(this.cy);153 },154 error => console.error('Something went terribly wrong with dagResult$')155 );156 }157 ngOnChanges() {158 this.wdlViewerService.setStatus(false);159 this.dagService.getDAGResults(this.selectedVersion, this.id);160 }161 download() {162 switch (this.dagType) {163 case 'wdlviewer':164 this.wdlViewer.download(this.exportLink);165 break;166 default:167 this.dagService.download(this.cy, this.selectedVersion.name, this.exportLink);168 break;169 }170 }...

Full Screen

Full Screen

dag.service.spec.ts

Source:dag.service.spec.ts Github

copy

Full Screen

1/*2 * Copyright 2017 OICR3 *4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 *8 * http://www.apache.org/licenses/LICENSE-2.09 *10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */16import { Renderer2 } from '@angular/core';17import { inject, TestBed } from '@angular/core/testing';18import { WorkflowsService } from '../../../shared/swagger/api/workflows.service';19import { WorkflowsStubService } from '../../../test/service-stubs';20import { DagQuery } from './dag.query';21import { DagService } from './dag.service';22import { DagStore } from './dag.store';23/* tslint:disable:no-unused-variable */24describe('Service: Dag', () => {25 beforeEach(() => {26 TestBed.configureTestingModule({27 providers: [DagService, DagStore, DagQuery, Renderer2, { provide: WorkflowsService, useClass: WorkflowsStubService }]28 });29 });30 it('should ...', inject([DagService], (service: DagService) => {31 expect(service).toBeTruthy();32 }));33 it(`should check if it's n/a`, inject([DagService], (service: DagService) => {34 expect(service.isNA('n/a')).toBeTruthy();35 expect(service.isNA('asdf')).toBeFalsy();36 }));37 it('should set dynamic popover with lots of n/a', inject([DagService], (service: DagService) => {38 const tooltipText = `39 <div>40 <div><b>Type: </b>n/a</div>41 <div><b>Run: </b>n/a</div>42 <div><b>Docker: </b>n/a</div>43 </div>`;44 expect(service.getTooltipText(undefined, '', undefined, undefined, undefined)).toEqual(tooltipText);45 }));46 it('should set dynamic popover with lots of other info', inject([DagService], (service: DagService) => {47 expect(service.getTooltipText(undefined, '', undefined, 'valid link', 'http://fakewebsite.com')).toEqual(`48 <div>49 <div><b>Type: </b>n/a</div>50 <div><b>Run: </b> <a href='http://fakewebsite.com'>http://fakewebsite.com</a></div>51 <div><b>Docker: </b> <a href=''>valid link</a></div>52 </div>`);53 }));54 it('should get DAG', inject([DagService], (service: DagService) => {55 service.getCurrentDAG(2, 2).subscribe(results => expect(results).toEqual('someDAG'));56 expect(service.getCurrentDAG(null, null)).toBeFalsy();57 }));...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var DAGService = require('ipfs-merkle-dag').DAGService;2var tracetest = require('tracetest');3var test = new tracetest.Test(DAGService);4test.test();5var Test = function(DAGService) {6 this.DAGService = DAGService;7 this.test = function() {8 var dag = new this.DAGService();9 console.log(dag);10 }11};12module.exports.Test = Test;13 at Test.test (C:\Users\jason\Documents\GitHub\ipfs-trace-test\tracetest.js:6:21)14 at Test (C:\Users\jason\Documents\GitHub\ipfs-trace-test\tracetest.js:3:8)15 at Object.<anonymous> (C:\Users\jason\Documents\GitHub\ipfs-trace-test\test.js:4:13)16 at Module._compile (module.js:570:32)17 at Object.Module._extensions..js (module.js:579:10)18 at Module.load (module.js:487:32)19 at tryModuleLoad (module.js:446:12)20 at Function.Module._load (module.js:438:3)21 at Function.Module.runMain (module.js:604:10)22 at startup (bootstrap_node.js:158:16)

Full Screen

Using AI Code Generation

copy

Full Screen

1var tracetest = require('tracetest');2var dagService = tracetest.dagService;3var dag = new dagService();4dag.get('key', function(err, value) {5 console.log(err);6 console.log(value);7});8var tracetest = {};9tracetest.dagService = function() {10 this.get = function(key, callback) {11 callback('Error', 'Value');12 };13};14module.exports = tracetest;15var tracetest = require('tracetest');16var dagService = tracetest.dagService;17var dag = new dagService();18dag.get('key', function(err, value) {19 console.log(err);20 console.log(value);21});22var tracetest = {};23tracetest.dagService = function() {24 this.get = function(key, callback) {25 callback('Error', 'Value');26 };27};28module.exports = tracetest;29You can use the module by doing require('tracetest') in test.js30var tracetest = require('tracetest');

Full Screen

Using AI Code Generation

copy

Full Screen

1const tracetesting = require('ipfs-trace-testing');2const dagService = tracetesting.dagService;3const DAGService = require('ipld-dag-service');4const dagService = new DAGService();5const IPFS = require('ipfs');6const node = new IPFS();7const IPFS = require('ipfs-core');8const node = new IPFS();9const ipfsClient = require('ipfs-http-client');10const node = ipfsClient();11const ipfsClient = require('ipfs-http-client');12const node = ipfsClient();13const IPFS = require('ipfs-core');14const node = new IPFS();15const IPFS = require('ipfs');16const node = new IPFS();17const IPFS = require('ipfs-core');18const node = new IPFS();19const IPFS = require('ipfs');20const node = new IPFS();21const IPFS = require('ipfs-core');22const node = new IPFS();23const IPFS = require('ipfs');24const node = new IPFS();

Full Screen

Using AI Code Generation

copy

Full Screen

1var DAGService = require('./dag.js').DAGService;2var dagService = new DAGService();3var hash = dagService.put('Hello World');4console.log('Hello World hash: ' + hash);5var data = dagService.get(hash);6console.log('Hello World data: ' + data);7console.log('Hello World data length: ' + data.length);

Full Screen

Using AI Code Generation

copy

Full Screen

1var ipfs = require('ipfs-api')('localhost', '5001', {protocol: 'http'});2var dag = new ipfs.dag();3var node = {4 Data: Buffer.from('8=C'),5};6dag.put(node, function(err, cid) {7 if (err) {8 throw err;9 }10 console.log(cid.toBaseEncodedString());11 dag.get(cid, function(err, node) {12 if (err) {13 throw err;14 }15 console.log(node.value);16 });17});18var ipfs = require('ipfs-api')('localhost', '5001', {protocol: 'http'});19var dag = new ipfs.dag();20var node = {21 Data: Buffer.from('8=C'),22};23dag.put(node, function(err, cid) {24 if (err) {25 throw err;26 }27 console.log(cid.toBaseEncodedString());28 dag.get(cid, function(err, node) {29 if (err) {30 throw err;31 }32 console.log(node.value);33 });34});

Full Screen

Using AI Code Generation

copy

Full Screen

1var tracetest = require("tracetest");2tracetest.DAGService();3DAGService() called4var tracetest = require("tracetest");5tracetest.DAGService("Hello world");6var tracetest = require("tracetest");7tracetest.DAGService(100);8var tracetest = require("tracetest");9tracetest.DAGService({name: "John", age: 30});10var tracetest = require("tracetest");11tracetest.DAGService([1, 2, 3]);12var tracetest = require("tracetest");13tracetest.DAGService(function(){});14DAGService called with argument function (){}15var tracetest = require("tracetest");16tracetest.DAGService(function(a){});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tracetest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful