Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
3e00a17
SED-4412 step-icon tests
dvladir Dec 3, 2025
dd8f0a1
SED-4412 step-tabs tests
dvladir Dec 3, 2025
0e13014
SED-4412 Trace viewer tests
dvladir Dec 3, 2025
604704a
SED-4412 Errors-list and form field tests
dvladir Dec 10, 2025
2f0149a
SED-4412 Progress bar
dvladir Dec 10, 2025
6bc63c0
SED-4412 Key value component
dvladir Dec 10, 2025
0b4c43a
SED-4412 key-value-inline tests
dvladir Dec 11, 2025
bea1757
SED-4412 Pretty print tests
dvladir Dec 11, 2025
c83aea8
SED-4412 select tests
dvladir Dec 12, 2025
a991f52
SED-4412 Select component tests
dvladir Dec 30, 2025
0647922
Merge branch 'master' into SED-4412-create-jest-tests-for-base-compon…
dvladir Dec 30, 2025
ae2021f
SED-4412 Artefact Inline Details header tests
dvladir Dec 30, 2025
1a2a031
SED-4412 Streaming Attachment Indicator component
dvladir Dec 30, 2025
bae5a12
SED-4412 AutoShrinkItemValueComponent tests
dvladir Dec 30, 2025
4aa73d9
SED-4412 Cron based components
dvladir Jan 15, 2026
c8b959b
SED-4412 Cron unit tests
dvladir Jan 15, 2026
f8e4485
SED-4412 Popover component tests
dvladir Jan 16, 2026
d4c3c60
Merge branch 'master' into SED-4412-create-jest-tests-for-base-compon…
dvladir Jan 16, 2026
5461995
SED-4412 Custom item renderer
dvladir Jan 20, 2026
41d5ea1
SED-4412 Relative Time Picker
dvladir Jan 20, 2026
3b4ee16
SED-4412 Array Input Component tests
dvladir Jan 20, 2026
7b8e309
SED-4412 Autocomplete input tests
dvladir Jan 20, 2026
d0938b7
SED-4412 Preset editor test
dvladir Jan 20, 2026
cc50e0e
SED-4412 Editable actions component test
dvladir Jan 20, 2026
55dfb98
SED-4412 Add Field Button component
dvladir Jan 21, 2026
515754f
SED-4412 Resource label component tests
dvladir Jan 21, 2026
e514a56
SED-4412 Automation package info tests
dvladir Jan 21, 2026
cef0b20
Merge branch 'master' into SED-4412-create-jest-tests-for-base-compon…
dvladir Jan 21, 2026
d8526fa
SED-4412 Fix exports
dvladir Jan 21, 2026
91101b4
Merge branch 'master' into SED-4412-create-jest-tests-for-base-compon…
neogucky Feb 3, 2026
db00eae
Apply suggestion from @neogucky
neogucky Feb 5, 2026
c59ae21
Merge branch 'master' into SED-4412-create-jest-tests-for-base-compon…
neogucky Feb 5, 2026
4b62926
SED-4412 Added some timeouts
neogucky Feb 5, 2026
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
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ module.exports = {
],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>' }),
modulePathIgnorePatterns: ['<rootDir>/dist/'],
testEnvironment: '@happy-dom/jest-environment',
};
40 changes: 40 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
"jest": "29.5.0",
"@types/jest": "29.5.14",
"jest-preset-angular": "14.6.2",
"@happy-dom/jest-environment": "19.0.2",
"ts-jest": "29.4.4"
Comment on lines 113 to 115

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add missing comma to keep package.json valid

The new devDependency entry is missing a trailing comma, so the file is no longer valid JSON. This will cause npm install/npm ci to fail to parse package.json, blocking dependency installation and any scripts that read it.

Useful? React with 👍 / 👎.

},
"engines": {
Expand Down
15 changes: 15 additions & 0 deletions projects/step-core/src/lib/client/step-client-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import { BaseHttpRequest } from './generated/core/BaseHttpRequest';
import { OPEN_API_CONFIG_PROVIDER } from './generated/open-api-config.provider';
import { lazyLoadedMainInterceptor } from './augmented/interceptros/lazy-loaded.interceptor';
import { TableRemoteDataSourceFactoryService } from './table';

export * from './generated/core/BaseHttpRequest';
export { ApiError } from './generated/core/ApiError';
Expand All @@ -31,3 +32,17 @@ export const provideStepApi = (...features: HttpFeature<HttpFeatureKind>[]) =>
useExisting: StepHttpRequestService,
},
]);

export const provideTestStepApi = () =>
makeEnvironmentProviders([
provideHttpClient(withInterceptorsFromDi()),
OPEN_API_CONFIG_PROVIDER,
{
provide: BaseHttpRequest,
useExisting: StepHttpRequestService,
},
{
provide: TableRemoteDataSourceFactoryService,
useValue: null,
},
]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { Component, signal } from '@angular/core';
import { ArtefactInlineDetailsHeaderComponent } from '@exense/step-core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';

@Component({
selector: 'step-artefact-inline-details-header-test',
imports: [ArtefactInlineDetailsHeaderComponent],
template: `
<step-artefact-inline-details-header [template]="foo" [isVisible]="isVisible()" />
<ng-template #foo>
<div class="testDiv">FOO</div>
</ng-template>
`,
})
class ArtefactInlineDetailsHeaderTestComponent {
readonly isVisible = signal(false);
}

describe('ArtefactInlineDetailsHeader', () => {
let fixture: ComponentFixture<ArtefactInlineDetailsHeaderTestComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({ imports: [ArtefactInlineDetailsHeaderTestComponent] }).compileComponents();

fixture = TestBed.createComponent(ArtefactInlineDetailsHeaderTestComponent);
fixture.detectChanges();
await fixture.whenStable();
});

it('Content visibility', async () => {
let content = fixture.debugElement.query(By.css('.testDiv'));
expect(content).toBeNull();

fixture.componentInstance.isVisible.set(true);
fixture.detectChanges();
await fixture.whenStable();

content = fixture.debugElement.query(By.css('.testDiv'));
expect(content).not.toBeNull();
expect((content.nativeElement as HTMLElement).textContent).toBe('FOO');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {
AttachmentMeta,
AugmentedResourcesService,
StreamingAttachmentIndicatorComponent,
StreamingAttachmentMeta,
} from '@exense/step-core';
import { v4 } from 'uuid';
import { By } from '@angular/platform-browser';
import { MatProgressSpinner } from '@angular/material/progress-spinner';
import { AugmentedStreamingResourcesService } from '../../../../client/augmented/services/augmented-streaming-resources.service';

const SIMPLE_ATTACHMENT: AttachmentMeta = {
name: 'test.jpg',
mimeType: 'image/jpeg',
type: 'step.attachment.AttachmentMeta',
id: v4(),
};

const STREAMING_ATTACHMENT: StreamingAttachmentMeta = {
name: 'test.txt',
mimeType: 'plain/text',
type: 'step.attachments.StreamingAttachmentMeta',
id: v4(),
currentNumberOfLines: 10,
status: 'INITIATED',
};

const IN_PROGRESS_STREAMING_ATTACHMENT: StreamingAttachmentMeta = {
...STREAMING_ATTACHMENT,
status: 'IN_PROGRESS',
};

describe('StreamingAttachmentIndicatorComponent', () => {
let fixture: ComponentFixture<StreamingAttachmentIndicatorComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [StreamingAttachmentIndicatorComponent],
providers: [
{
provide: AugmentedResourcesService,
useValue: null,
},
{
provide: AugmentedStreamingResourcesService,
useValue: null,
},
],
}).compileComponents();
fixture = TestBed.createComponent(StreamingAttachmentIndicatorComponent);
fixture.detectChanges();
await fixture.whenStable();
});

it('Check indicator visibility', async () => {
let indicator = fixture.debugElement.query(By.directive(MatProgressSpinner));
expect(indicator).toBeNull();

fixture.componentRef.setInput('attachment', SIMPLE_ATTACHMENT);
fixture.detectChanges();
await fixture.whenStable();
indicator = fixture.debugElement.query(By.directive(MatProgressSpinner));
expect(indicator).toBeNull();

fixture.componentRef.setInput('attachment', STREAMING_ATTACHMENT);
fixture.detectChanges();
await fixture.whenStable();
indicator = fixture.debugElement.query(By.directive(MatProgressSpinner));
expect(indicator).toBeNull();

fixture.componentRef.setInput('attachment', IN_PROGRESS_STREAMING_ATTACHMENT);
fixture.detectChanges();
await fixture.whenStable();
indicator = fixture.debugElement.query(By.directive(MatProgressSpinner));
expect(indicator).not.toBeNull();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { TraceViewerComponent } from './trace-viewer.component';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { APP_HOST } from '../../../../client/_common';
import { By } from '@angular/platform-browser';
import { ComponentRef } from '@angular/core';
import { DOCUMENT } from '@angular/common';

describe('Trace Viewer', () => {
let componentRef: ComponentRef<TraceViewerComponent>;
let fixture: ComponentFixture<TraceViewerComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [TraceViewerComponent],
providers: [
{
provide: APP_HOST,
useValue: 'https://step.ch',
},
],
}).compileComponents();

fixture = TestBed.createComponent(TraceViewerComponent);
componentRef = fixture.componentRef;
fixture.detectChanges();
});

it('Initial view', async () => {
const iframe = fixture.debugElement.query(By.css('iframe'));
expect(iframe.nativeElement.src).toEqual('https://step.ch/trace-viewer/');
});

it('Set report url', async () => {
componentRef.setInput('reportUrl', 'https://step.ch/reports/1');
fixture.detectChanges();
await fixture.whenStable();
const iframe = fixture.debugElement.query(By.css('iframe'));
expect(iframe.nativeElement.src).toEqual('https://step.ch/trace-viewer/?trace=https://step.ch/reports/1');
});

it('Oper url', async () => {
componentRef.setInput('reportUrl', 'https://step.ch/reports/1');
fixture.detectChanges();
await fixture.whenStable();

const doc = TestBed.inject(DOCUMENT);
const spyWindowOpen = jest.spyOn(doc.defaultView!, 'open').mockImplementation(() => {});

expect(spyWindowOpen).not.toHaveBeenCalled();
componentRef.instance.openInSeparateTab();
expect(spyWindowOpen).toHaveBeenCalledWith(
'https://step.ch/trace-viewer/?trace=https://step.ch/reports/1',
'_blank',
);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import { Component, Directive, signal } from '@angular/core';
import { KeyValue } from '@angular/common';
import { AutoShrinkItemValueComponent } from '@exense/step-core';
import { TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';

@Directive()
abstract class AutoShrinkItemValueBaseComponent {
readonly item = signal<KeyValue<string, string>>({ key: '', value: '' });
}

@Component({
selector: 'step-auto-shrink-item-value-without-template-test',
imports: [AutoShrinkItemValueComponent],
template: `
@if (item(); as item) {
<step-auto-shrink-item-value [item]="item" />
}
`,
})
class AutoShrinkItemValueWithoutTemplateComponent extends AutoShrinkItemValueBaseComponent {}

@Component({
selector: 'step-auto-shrink-item-value-with-template-test',
imports: [AutoShrinkItemValueComponent],
template: `
@if (item(); as item) {
<step-auto-shrink-item-value [item]="item" [emptyValueTemplate]="test" />
}
<ng-template #test>
<div class="test">EMPTY</div>
</ng-template>
`,
})
class AutoShrinkItemValueWithTemplateComponent extends AutoShrinkItemValueBaseComponent {}

describe('AutoShrinkItemValueComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AutoShrinkItemValueWithoutTemplateComponent, AutoShrinkItemValueWithTemplateComponent],
}).compileComponents();
});

it('Without empty template', async () => {
let fixture = TestBed.createComponent(AutoShrinkItemValueWithoutTemplateComponent);
fixture.detectChanges();
await fixture.whenStable();

expect((fixture.nativeElement as HTMLElement).innerText.trim()).toBe('');
fixture.componentInstance.item.set({ key: 'foo', value: 'FOO' });
fixture.detectChanges();
await fixture.whenStable();

expect((fixture.nativeElement as HTMLElement).innerText.trim()).toBe('FOO');
});

it('With empty template', async () => {
let fixture = TestBed.createComponent(AutoShrinkItemValueWithTemplateComponent);
fixture.detectChanges();
await fixture.whenStable();

let emptyContainer = fixture.debugElement.query(By.css('.test'));
expect(emptyContainer).not.toBeNull();
expect((emptyContainer.nativeElement as HTMLElement).innerText).toBe('EMPTY');

fixture.componentInstance.item.set({ key: 'foo', value: 'FOO' });
fixture.detectChanges();
await fixture.whenStable();

emptyContainer = fixture.debugElement.query(By.css('.test'));
expect(emptyContainer).toBeNull();
expect((fixture.nativeElement as HTMLElement).innerText.trim()).toBe('FOO');
});
});
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<div>
{{(automationPackage$ | async)?.attributes?.['name'] ?? ''}}
</div>
<div>{{ (automationPackage$ | async)?.attributes?.['name'] ?? '' }}</div>
Loading