angular7

configure jasmine to not run tests randomly

痞子三分冷 提交于 2020-08-27 05:30:27
问题 i just upgraded to jasmine 3.3 and now my tests by default run in random order. Is there a way to configure karma and jasmine to make tests run like they used to before upgrading to this new version? 回答1: In Karma config under client: you are supposed to be able to set jasmine:{random:false} but that does not work for me. Does it for you? See below link from docs and screen cap. https://github.com/karma-runner/karma-jasmine 来源: https://stackoverflow.com/questions/53086722/configure-jasmine-to

How to use primeng dropdown?

北慕城南 提交于 2020-08-11 02:59:25
问题 I used the "select" for the dropdown. Below is the coding. <div class="ui-grid-col-6"> <div class="form-group"> <select name="status" formControlName="purchaseOrderStatusId"> <option>Select PurchaseOrderStatus</option> <option *ngFor="let PurchaseOrderStatus of allPurchaseOrderStatus" value="{{ PurchaseOrderStatus.id }}"> {{ PurchaseOrderStatus.code }} </option> </select> </div> </div> Here all values from the API are saved in the variable allPurchaseOrderStatus . And I want id as my stored

Error: Expected one matching request for criteria “Match by function: ”, found none

你。 提交于 2020-08-07 05:45:38
问题 I have a userService.spec.ts file that I want to test.The code goes this way. It calls a get function that calls the ADMIN_API_URL .I tried testing the given file but got an error that is mentioned in the title. My user.service.spec.ts file. describe('Service: User service', () => { let httpMock: HttpTestingController; let userService: UserService; let url: string; beforeEach(() => { TestBed.configureTestingModule({ imports: [HttpClientTestingModule], providers: [ { provide: AUTH_API_URL,

Error: Expected one matching request for criteria “Match by function: ”, found none

戏子无情 提交于 2020-08-07 05:44:59
问题 I have a userService.spec.ts file that I want to test.The code goes this way. It calls a get function that calls the ADMIN_API_URL .I tried testing the given file but got an error that is mentioned in the title. My user.service.spec.ts file. describe('Service: User service', () => { let httpMock: HttpTestingController; let userService: UserService; let url: string; beforeEach(() => { TestBed.configureTestingModule({ imports: [HttpClientTestingModule], providers: [ { provide: AUTH_API_URL,

How to set the initial index (position) for the CdkVirtualScrollViewport in Angular 7

不羁岁月 提交于 2020-08-07 01:26:31
问题 I need the inital position of the cdk-virtual-scroll-viewport to be other than the first element / item of the list. Now I found the scrollToIndex and scrollTo methods, but I only can get them to work when using it in the ngAfterViewChecked , which feels off. Can someone confirm that the using those methods in the ngAfterViewChecked is the right way of doing things? If not, show an alternative method / technique? @ViewChild(CdkVirtualScrollViewport) cdkVirtualScrollViewport: