All Questions
18 questions
0
votes
1
answer
21
views
fControl.get is not a function in angular unit test
Trying to write an unit test for changeFunctionalityStatus(). facing the issue like fControl.get is not a function .
Stuck with this Anyone pls help me why this issue coming. TIA
...
0
votes
1
answer
35
views
How to write unit test case using Jamine to test form controls touched, untouched and dirty conditions
I have a form built using reactive forms angular and I have the below code.
The entire if conditions says , branch not covered, how can i make sure the branch is covered.
this.tableOptions.rowData....
0
votes
0
answers
104
views
"Test suite failed to run Cannot find module" getting issue with absolute path in Angular 14 test suite
I have just upgraded my Angular project from Angular 13 to Angular 14, Functionality wise everything is working fine but whenever I tried to run the test suite I am getting below error
Test suite ...
0
votes
0
answers
366
views
How to mock blob response from API in Angular test case
In my angular application, I have a REST API call which returns me a Blob data which is eventually opened in a new tab.
I am trying to create a mock Blob object in my jasmine testcase and spyon the ...
0
votes
0
answers
262
views
Ionic Capacitor Push Notification Test Case
I'm currently learning how to build a push notification application using Ionic Capacitor and Firebase, was wondering how to mock up or do test cases on the push notification methods.
Currently using ...
1
vote
0
answers
532
views
Unhandled promise rejection: Timeout thrown
I am working on unit test case in angular 12 and i discover this random behaviour of test case where i found that some times my test cases are working normally and some times it throwing this error &...
0
votes
1
answer
1k
views
How to write test case for rxjs interval in angular 8?
I have one method "intervalCall()" into app.component.ts and sending the request every 60 seconds using rxjs interval, so want to test case for it for spect file, below is the method.
...
0
votes
0
answers
760
views
Test case writing for If Else statement
I am writing test case for the conditional if=else statement in angular , test case is not having any error, but when I run the ng test then in code coverage its showing if-else statement is not ...
1
vote
0
answers
117
views
How To Write Functions Test Cases In Angular?
I Want to Know about Component.Ts File Test Cases ?
Test Cases Only For Functions And Methods like Insert,Update,Delete and Get.
Compant.ts
getCompanies() {
this.$.Api.Company.getAllCompanies()....
0
votes
2
answers
58
views
Unit testing for service class which calls backendserver- angular
I have a method in-service class which has a GET Call to the backend server and backendserver returns a response of people array with fields - employedID ,name, and busnTitle.
Could you help to cover ...
0
votes
0
answers
75
views
Export Function From Test file and use it in component file?
I am new in Angular and NodeJS UTs. I have a function in test file and I have exported that function to use it in another file but once I call it from another file then I am receiving an error of ...
1
vote
1
answer
517
views
jasmine test failure: Expected spy openQuickSubtypes to have been called. Context menu test cas
I am getting error for jasmine test, Expected spy openQuickSubtypes to have been called.
I have implemented context menu.
component.html
<div class="each-shift" *ngFor="let shift of ...
0
votes
1
answer
205
views
Angular 7 test case throwing broadcaster error
while running test cases it throws this error.
Almost added all required components and services and other dependencies though it is throwing error while running test-cases in Angular &
Error: ...
0
votes
1
answer
2k
views
Angular 5 - Jasmine / Karma Test Case: Button Enable / Disable by input validation
I am still new to Angular and its testing frameworks, Jasmine and Karma.
I’m stuck on testing a button to make sure that when the user enters the correct information, it is always enabled; mainly ...
3
votes
1
answer
8k
views
How to mock an @INPUT value in tests for angular component
In my angular app, I am writing a testcase for a component which has @Input value.
How can I mock the @Input value.
The main component's testSave() method uses subComponent's InputObject's id.
When I ...
0
votes
1
answer
75
views
angular 2 unit test case error
here am stuck with one error in my angular 2 unit test case
error is: Error: Uncaught (in promise): Error: Error in ./Titles class Titles_Host - inline template:0:0 caused by: No provider for Token ...
1
vote
1
answer
529
views
How to write the test case in Jasmine in Angular2 for redirect URL?
SecurityService.prototype.Feedback = function () {
window.open('https://www.google.com/', '_blank');
I need to write the test case for above code in Jasmine in Angular 2.
0
votes
1
answer
33
views
Unable to cover or conditioned line in test case
I am one function where I am returning values like this...
GetData(){
let parsedData= JSON.parse(data.data.json);
return {
x: parsedData.x|| [],
y: parsedData.y|| []
...