Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
mollykreis committed Dec 6, 2024
1 parent 542cedd commit 027838f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export class ErrorPatternPageObject {

public getDisplayedErrorText(): string {
const errorTextDiv = this.getErrorTextElement();
if (!errorTextDiv || getComputedStyle(errorTextDiv).display === 'none') {
if (
!errorTextDiv
|| getComputedStyle(errorTextDiv).display === 'none'
) {
return '';
}
return errorTextDiv.textContent?.trim() ?? '';
Expand Down Expand Up @@ -47,4 +50,4 @@ export class ErrorPatternPageObject {
private getErrorTextElement(): HTMLDivElement | null {
return this.element.shadowRoot!.querySelector('.error-text');
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { customElement, html } from '@microsoft/fast-element';
import { FoundationElement } from '@microsoft/fast-foundation';
import { Fixture, fixture, uniqueElementName } from '../../../utilities/tests/fixture';
import {
Fixture,
fixture,
uniqueElementName
} from '../../../utilities/tests/fixture';
import { mixinErrorPattern } from '../types';
import { styles } from '../styles';
import { errorTextTemplate } from '../template';
Expand All @@ -14,8 +18,7 @@ const elementName = uniqueElementName();
template: html`<${iconExclamationMarkTag} class="error-icon"></${iconExclamationMarkTag}>${errorTextTemplate}`,
styles
})
class TestErrorPatternElement extends mixinErrorPattern(FoundationElement) {
}
class TestErrorPatternElement extends mixinErrorPattern(FoundationElement) {}

async function setup(): Promise<Fixture<TestErrorPatternElement>> {
return await fixture(elementName);
Expand Down Expand Up @@ -111,4 +114,4 @@ describe('ErrorPatternMixin', () => {
expect(pageObject.getErrorTextTitle()).toBe('');
});
});
});
});
9 changes: 4 additions & 5 deletions packages/nimble-components/src/patterns/error/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ type FASTElementConstructor = abstract new (...args: any[]) => FASTElement;

// As the returned class is internal to the function, we can't write a signature that uses is directly, so rely on inference
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
export function mixinErrorPattern<TBase extends FASTElementConstructor>(base: TBase) {
export function mixinErrorPattern<TBase extends FASTElementConstructor>(
base: TBase
) {
/**
* The Mixin that provides a concrete column with the API to support being resized
* proportionally within a Table.
Expand Down Expand Up @@ -42,9 +44,6 @@ export function mixinErrorPattern<TBase extends FASTElementConstructor>(base: TB
ErrorPatternElement.prototype,
'errorVisible'
);
observable(
ErrorPatternElement.prototype,
'errorHasOverflow'
);
observable(ErrorPatternElement.prototype, 'errorHasOverflow');
return ErrorPatternElement;
}
2 changes: 1 addition & 1 deletion packages/nimble-components/src/radio-group/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export { Orientation };
/**
* A nimble-styled grouping element for radio buttons
*/
export class RadioGroup extends mixinErrorPattern(FoundationRadioGroup) { }
export class RadioGroup extends mixinErrorPattern(FoundationRadioGroup) {}

const nimbleRadioGroup = RadioGroup.compose({
baseName: 'radio-group',
Expand Down

0 comments on commit 027838f

Please sign in to comment.