-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0248b81
commit 1189887
Showing
2 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
frontend/src/app/GN2CommonModule/form/datasets/datasets.component.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { DatasetsComponent } from "./datasets.component" | ||
import { | ||
IterableDiffers, | ||
} from '@angular/core'; | ||
import { DataFormService } from "../data-form.service"; | ||
import { EMPTY, Observable, from } from 'rxjs'; | ||
import * as gerard from '../../GN2Common.module'; | ||
import { UntypedFormControl } from "@angular/forms"; | ||
export class DataFormServiceMock { | ||
|
||
constructor() { } | ||
getDatasets(params, queryStrings = {}, fields = []) { | ||
console.log("pouet") | ||
return from([{ dataset_name: "test" }]) | ||
} | ||
} | ||
|
||
describe("Dataset Component", () => { | ||
it("show component", () => { | ||
cy.mount(DatasetsComponent, { | ||
componentProperties: { | ||
idAcquisitionFramework: 0, | ||
displayOnlyActive: true, | ||
parentFormControl: new UntypedFormControl() | ||
}, | ||
imports: [], | ||
declarations: [DatasetsComponent], | ||
providers: [ | ||
IterableDiffers, | ||
{ provide: DataFormService, useClass: DataFormServiceMock } | ||
] | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters