Skip to content

Commit

Permalink
minor clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
mollykreis committed Dec 12, 2024
1 parent 7432453 commit 5e6bf30
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,13 @@ describe('Combobox', () => {
expect(element.control.getAttribute('disabled')).not.toBeNull();
});

it('should set "aria-required" to true when "required-visible" is true', async () => {
await connect();
it('should set "aria-required" to true when "required-visible" is true', () => {
element.requiredVisible = true;
processUpdates();
expect(element.control.getAttribute('aria-required')).toBe('true');
});

it('should set "aria-required" to false when "required-visible" is false', async () => {
await connect();
it('should set "aria-required" to false when "required-visible" is false', () => {
element.requiredVisible = false;
processUpdates();
expect(element.control.getAttribute('aria-required')).toBe('false');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('Radio Group', () => {

beforeEach(async () => {
({ element, connect, disconnect } = await setup());
await connect();
});

afterEach(async () => {
Expand All @@ -28,15 +29,13 @@ describe('Radio Group', () => {
);
});

it('should set "aria-required" to true when "required-visible" is true', async () => {
await connect();
it('should set "aria-required" to true when "required-visible" is true', () => {
element.requiredVisible = true;
processUpdates();
expect(element.getAttribute('aria-required')).toBe('true');
});

it('should set "aria-required" to false when "required-visible" is false', async () => {
await connect();
it('should set "aria-required" to false when "required-visible" is false', () => {
element.requiredVisible = false;
processUpdates();
expect(element.getAttribute('aria-required')).toBe('false');
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/src/utilities/storybook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export const placeholderDescription = (options: {
export const errorTextDescription = 'A message to be displayed explaining why the value is invalid. Only visible when `error-visible` is set.';
export const errorVisibleDescription = 'When set to `true`, an error indicator will be displayed within the control and the `error-text` message will be displayed.';

export const requiredVisibleDescription = 'When set to `true`, an indicator will be displayed within the control to indicate that the field is required. A control should not set `required-visible` on disabled or readonly controls.';
export const requiredVisibleDescription = 'When set to `true`, an indicator will be displayed within the control to indicate that the field is required. A disabled or readonly control should not also be marked as `required-visible`.';

export const dropdownPositionDescription = (options: {
componentName: string
Expand Down

0 comments on commit 5e6bf30

Please sign in to comment.