Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion modules/ui/src/app/pages/testrun/progress.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ describe('ProgressComponent', () => {

describe('Class tests', () => {
beforeEach(() => {
// @ts-expect-error data layer should be defined
window.dataLayer = window.dataLayer || [];
testRunServiceMock.stopTestrun.and.returnValue(of(true));

TestBed.configureTestingModule({
declarations: [
ProgressComponent,
Expand Down Expand Up @@ -209,6 +210,8 @@ describe('ProgressComponent', () => {
beforeEach(async () => {
testRunServiceMock.stopTestrun.and.returnValue(of(true));
testRunServiceMock.testrunInProgress.and.returnValue(false);
// @ts-expect-error data layer should be defined
window.dataLayer = window.dataLayer || [];

await TestBed.configureTestingModule({
declarations: [
Expand Down
4 changes: 4 additions & 0 deletions modules/ui/src/app/pages/testrun/progress.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ export class ProgressComponent implements OnInit, OnDestroy {
.pipe(takeUntil(this.destroy$))
.subscribe((startTestrun: boolean) => {
if (startTestrun) {
// @ts-expect-error data layer is not null
window.dataLayer.push({
event: 'successful_testrun_initiation',
});
this.testrunStore.setIsTestrunStarted(true);
this.testrunStore.getStatus();
}
Expand Down