I've been tasked with modifying an existing Angular project that includes a component where I have the following variable:
public testRunDetails: ITestRunDetails[] = [];
The variable testRunDetails
is of type ITestRunDetails
, which is defined as:
export interface ITestRun {
ExecutionStartedOn: string;
ExecutionEndedOn: string;
ExecutionStatus: string;
ExecutionResult: string;
TotalCnt?: number;
PassedCnt?: number;
FailedCnt?: number;
CompletedCnt?: number;
...
...
}
I'm attempting to modify the properties of this variable within a function like so:
public changeRunStausRealTime() {
this.hubConnection.on('transfermessage', (data) => {
console.log('Message from signalr')
for (var test of this.testRunDetails) {
test.ExecutionStatus = "Completed"
test.ExecutionResult = "Passed"
test.CurrentStatus = "Test Execution - Pass"
}
}
)
The properties ExecutionStatus
and ExecutionResult
are part of the ITestRun
interface, but CurrentStatus
is not. However, when debugging the code, I can see the CurrentStatus
property for the test object
https://i.sstatic.net/v1v9H.png
Although I'm trying to update the values of ExecutionStatus
, ExecutionResult
, and CurrentStatus
properties, only ExecutionStatus
and ExecutionResult
are being modified while CurrentStatus
remains unchanged. This has left me puzzled as to why I can't update the value of CurrentStatus
. Additionally, why does it appear in the developer tools if it's not actually a property of the test
object?