Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/11.x.x' into action-hub-harness
Browse files Browse the repository at this point in the history
* origin/11.x.x:
  chore: release 11.32.0 (#2988)
  feat(components/forms): add method to `SkyFormErrorHarness` to get error text (#2992) (#2994)
  ci: fix e2e concurrency groups (#2989)
  • Loading branch information
johnhwhite committed Jan 9, 2025
2 parents 775d30f + 48ac35f commit 7742864
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 10 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: ${{ !startsWith( github.head_ref || github.ref_name, 'release-please--' ) && !contains( github.event.pull_request.labels.*.name, 'skip e2e' ) }}
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name || github.event.ref }}
group: ${{ github.workflow }}-install-deps-${{ github.head_ref || github.ref_name || github.event.ref }}
cancel-in-progress: true
outputs:
node-version: ${{ steps.setup-node.outputs.node-version }}
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
name: Build Project Storybook
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.job }}--${{ matrix.project }}-${{ github.head_ref || github.ref_name || github.event.ref }}
group: ${{ github.workflow }}-build-storybook--${{ matrix.project }}-${{ github.head_ref || github.ref_name || github.event.ref }}
cancel-in-progress: true
needs: install-deps
strategy:
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
name: Build Apps
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.job }}--${{ matrix.app }}-${{ github.head_ref || github.ref_name || github.event.ref }}
group: ${{ github.workflow }}-build-apps--${{ matrix.app }}-${{ github.head_ref || github.ref_name || github.event.ref }}
cancel-in-progress: true
needs: install-deps
strategy:
Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:
name: Publish
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name || github.event.ref }}
group: ${{ github.workflow }}-publish-${{ github.head_ref || github.ref_name || github.event.ref }}
cancel-in-progress: true
needs:
- install-deps
Expand Down Expand Up @@ -303,7 +303,7 @@ jobs:
runs-on: ubuntu-latest
# Baseline branches should complete the E2E jobs so Percy does not get stuck https://www.browserstack.com/question/61332
concurrency:
group: ${{ github.workflow }}-${{ github.job }}--${{ matrix.project }}-${{ github.head_ref || format('{0}-{1}', github.run_id, github.run_attempt) }}
group: ${{ github.workflow }}-e2e--${{ matrix.project }}-${{ github.head_ref || format('{0}-{1}', github.run_id, github.run_attempt) }}
cancel-in-progress: true
needs: install-deps
strategy:
Expand Down Expand Up @@ -415,7 +415,7 @@ jobs:
name: E2E Visual Review
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name || github.event.ref }}
group: ${{ github.workflow }}-verify-${{ github.head_ref || github.ref_name || github.event.ref }}
cancel-in-progress: false
needs:
- install-deps
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [11.32.0](https://github.com/blackbaud/skyux/compare/11.31.0...11.32.0) (2025-01-08)


### Features

* **components/forms:** add method to `SkyFormErrorHarness` to get error text ([#2992](https://github.com/blackbaud/skyux/issues/2992)) ([#2994](https://github.com/blackbaud/skyux/issues/2994)) ([65aa2e8](https://github.com/blackbaud/skyux/commit/65aa2e8eda1d5f58d6156080f5c46dddeb8a19db))
* **components/layout:** tokenize toolbar component ([#2980](https://github.com/blackbaud/skyux/issues/2980)) ([3c04ba0](https://github.com/blackbaud/skyux/commit/3c04ba0e105c6c50f917b85746efee7fab9e5e21))

## [11.31.0](https://github.com/blackbaud/skyux/compare/11.30.1...11.31.0) (2025-01-07)


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { HarnessLoader } from '@angular/cdk/testing';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { SKY_FORM_ERRORS_ENABLED, SkyFormErrorModule } from '@skyux/forms';

import { SkyFormErrorHarness } from './form-error-harness';

//#region Test component
@Component({
selector: 'sky-form-error-test',
providers: [
{
provide: SKY_FORM_ERRORS_ENABLED,
useValue: true,
},
],
template: `
<sky-form-error [errorName]="errorName" [errorText]="errorText" />
<sky-form-error
data-sky-id="other-error"
[errorName]="errorNameSkyId"
[errorText]="errorTextSkyId"
/>
`,
standalone: false,
})
class TestComponent {
public errorName = 'error';
public errorText = 'some-error';
public errorNameSkyId = 'error-sky-id';
public errorTextSkyId = 'some-error-sky-id';
}
//#endregion Test component

describe('Form error harness', () => {
async function setupTest(options: { dataSkyId?: string } = {}): Promise<{
formErrorHarness: SkyFormErrorHarness;
fixture: ComponentFixture<TestComponent>;
loader: HarnessLoader;
pageLoader: HarnessLoader;
}> {
await TestBed.configureTestingModule({
declarations: [TestComponent],
imports: [SkyFormErrorModule],
}).compileComponents();
const fixture = TestBed.createComponent(TestComponent);
const loader = TestbedHarnessEnvironment.loader(fixture);
const pageLoader = TestbedHarnessEnvironment.documentRootLoader(fixture);
const formErrorHarness: SkyFormErrorHarness = options.dataSkyId
? await loader.getHarness(
SkyFormErrorHarness.with({ dataSkyId: options.dataSkyId }),
)
: await loader.getHarness(SkyFormErrorHarness);
return { formErrorHarness, fixture, loader, pageLoader };
}

it('should get form error text', async () => {
const { formErrorHarness, fixture } = await setupTest();

fixture.detectChanges();

await expectAsync(formErrorHarness.getErrorText()).toBeResolvedTo(
fixture.componentInstance.errorText,
);
});

it('should get form error text by its data-sky-id', async () => {
const { formErrorHarness, fixture } = await setupTest({
dataSkyId: 'other-error',
});

fixture.detectChanges();

await expectAsync(formErrorHarness.getErrorText()).toBeResolvedTo(
fixture.componentInstance.errorTextSkyId,
);
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { HarnessPredicate } from '@angular/cdk/testing';
import { SkyComponentHarness } from '@skyux/core/testing';
import { SkyStatusIndicatorHarness } from '@skyux/indicators/testing';

import { SkyFormErrorHarnessFilters } from './form-error-harness.filters';

Expand All @@ -9,6 +10,10 @@ export class SkyFormErrorHarness extends SkyComponentHarness {
*/
public static hostSelector = 'sky-form-error';

async #getStatusIndicator(): Promise<SkyStatusIndicatorHarness> {
return await this.locatorFor(SkyStatusIndicatorHarness)();
}

/**
* Gets a `HarnessPredicate` that can be used to search for a
* `SkyFormErrorHarness` that meets certain criteria
Expand All @@ -25,4 +30,11 @@ export class SkyFormErrorHarness extends SkyComponentHarness {
public async getErrorName(): Promise<string | null> {
return await (await this.host()).getAttribute('errorName');
}

/**
* Gets the error text.
*/
public async getErrorText(): Promise<string | null> {
return await (await this.#getStatusIndicator()).getText();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { SkyFormErrorsHarness } from './form-errors-harness';
[touched]="true"
[dirty]="true"
[errors]="{ required: true }"
/>"`,
/>`,
})
class TestComponent {
public errorText: string | undefined = 'Form';
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "skyux",
"version": "11.31.0",
"version": "11.32.0",
"license": "MIT",
"scripts": {
"ng": "nx",
Expand Down

0 comments on commit 7742864

Please sign in to comment.