Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
mollykreis committed Dec 12, 2024
1 parent 2b481b2 commit 7432453
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { parameterizeSpec, parameterizeSuite } from '@ni/jasmine-parameterized';
import { fixture, Fixture } from '../../utilities/tests/fixture';
import { Combobox, comboboxTag } from '..';
import { ComboboxAutocomplete } from '../types';
import { processUpdates, waitForUpdatesAsync } from '../../testing/async-helpers';
import {
processUpdates,
waitForUpdatesAsync
} from '../../testing/async-helpers';
import { checkFullyInViewport } from '../../utilities/tests/intersection-observer';
import { listOptionTag } from '../../list-option';
import { ComboboxPageObject } from '../testing/combobox.pageobject';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ export function getRequiredVisibleLabelTemplate(
return html`
<div class="annotated-label">
${labelTemplate}
${when(x => x.requiredVisible, html`
${when(
x => x.requiredVisible,
html`
<${iconAsteriskTag} class="required-icon" severity="error"></${iconAsteriskTag}>
`)}
`
)}
</div>
`;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { FoundationElement } from '@microsoft/fast-foundation';
import { processUpdates } from '../../../testing/async-helpers';

/**
* A page object for the elements that use the required-visible mixin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ import { getRequiredVisibleLabelTemplate } from '../template';
import { processUpdates } from '../../../testing/async-helpers';
import { RequiredVisiblePatternPageObject } from '../testing/required-visible-pattern.pageobject';

const labelTemplate = getRequiredVisibleLabelTemplate(html`<slot name="label"></slot>`);
const labelTemplate = getRequiredVisibleLabelTemplate(
html`<slot name="label"></slot>`
);
const elementName = uniqueElementName();
@customElement({
name: elementName,
template: html`${labelTemplate}`,
styles
})
class TestErrorPatternElement extends mixinRequiredVisiblePattern(FoundationElement) {}
class TestErrorPatternElement extends mixinRequiredVisiblePattern(
FoundationElement
) {}

async function setup(): Promise<Fixture<TestErrorPatternElement>> {
return await fixture(elementName);
Expand Down
4 changes: 3 additions & 1 deletion packages/nimble-components/src/radio-group/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export { Orientation };
/**
* A nimble-styled grouping element for radio buttons
*/
export class RadioGroup extends mixinErrorPattern(mixinRequiredVisiblePattern(FoundationRadioGroup)) {}
export class RadioGroup extends mixinErrorPattern(
mixinRequiredVisiblePattern(FoundationRadioGroup)
) {}

const nimbleRadioGroup = RadioGroup.compose({
baseName: 'radio-group',
Expand Down
4 changes: 3 additions & 1 deletion packages/nimble-components/src/radio-group/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { errorTextTemplate } from '../patterns/error/template';
import { iconExclamationMarkTag } from '../icons/exclamation-mark';
import { getRequiredVisibleLabelTemplate } from '../patterns/required-visible/template';

const labelTemplate = getRequiredVisibleLabelTemplate(html<RadioGroup>`<slot name="label"></slot>`);
const labelTemplate = getRequiredVisibleLabelTemplate(
html<RadioGroup>`<slot name="label"></slot>`
);

/* eslint-disable @typescript-eslint/indent */
export const template = html<RadioGroup>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { Fixture, fixture } from '../../utilities/tests/fixture';
import { processUpdates } from '../../testing/async-helpers';

async function setup(): Promise<Fixture<RadioGroup>> {
return await fixture<RadioGroup>(html`<${radioGroupTag}></${radioGroupTag}>`);
return await fixture<RadioGroup>(
html`<${radioGroupTag}></${radioGroupTag}>`
);
}

describe('Radio Group', () => {
Expand Down
5 changes: 4 additions & 1 deletion packages/nimble-components/src/select/tests/select.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { fixture, Fixture } from '../../utilities/tests/fixture';
import { Select, selectTag } from '..';
import { SelectPageObjectInternal as SelectPageObject } from './select.pageobject.internal';
import { ListOption, listOptionTag } from '../../list-option';
import { processUpdates, waitForUpdatesAsync } from '../../testing/async-helpers';
import {
processUpdates,
waitForUpdatesAsync
} from '../../testing/async-helpers';
import { checkFullyInViewport } from '../../utilities/tests/intersection-observer';
import { FilterMode, SelectFilterInputEventDetail } from '../types';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { html } from '@microsoft/fast-element';
import { parameterizeSpec } from '@ni/jasmine-parameterized';
import { TextArea, textAreaTag } from '..';
import { processUpdates, waitForUpdatesAsync } from '../../testing/async-helpers';
import {
processUpdates,
waitForUpdatesAsync
} from '../../testing/async-helpers';
import { fixture, Fixture } from '../../utilities/tests/fixture';

async function setup(): Promise<Fixture<TextArea>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ const component = (
</${radioGroupTag}>`;

export const radioGroupThemeMatrix: StoryFn = createMatrixThemeStory(
createMatrix(component, [disabledStates, orientationStates, errorStates, requiredVisibleStates])
createMatrix(component, [
disabledStates,
orientationStates,
errorStates,
requiredVisibleStates
])
);

export const hiddenRadioGroup: StoryFn = createStory(
Expand Down

0 comments on commit 7432453

Please sign in to comment.