Skip to content

Commit

Permalink
Fix max-len issues in foundation
Browse files Browse the repository at this point in the history
  • Loading branch information
janechu committed May 23, 2024
1 parent 8ab1ce4 commit c002514
Show file tree
Hide file tree
Showing 33 changed files with 113 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ test.describe("Accordion", () => {
);
});

/* eslint-disable-next-line max-len */
test("should remove an expanded items' expandbutton aria-disabled attribute when expand mode changes from single to multi", async () => {
await root.evaluate(node => {
node.innerHTML = /* html */ `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import { AccordionExpandMode } from "./accordion.options.js";
* @public
*
* @remarks
* Designed to be used with {@link @microsoft/fast-foundation#accordionTemplate} and {@link @microsoft/fast-foundation#(FASTAccordionItem:class)}.
* Designed to be used with {@link @microsoft/fast-foundation#accordionTemplate}
* and {@link @microsoft/fast-foundation#(FASTAccordionItem:class)}.
*/
export class FASTAccordion extends FASTElement {
/**
Expand Down Expand Up @@ -242,7 +243,8 @@ export class FASTAccordion extends FASTElement {
};

private handleItemFocus = (event: FocusEvent): void => {
// update the active item index if the focus moves to an accordion item via a different method other than the up and down arrow key actions
// update the active item index if the focus moves to an accordion item
// via a different method other than the up and down arrow key actions
// only do so if the focus is actually on the accordion item and not on any of its children
if (event.target === event.currentTarget) {
const focusedItem = event.target as HTMLElement;
Expand Down
9 changes: 6 additions & 3 deletions packages/web-components/fast-foundation/src/anchor/anchor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export type AnchorOptions = StartEndOptions<FASTAnchor>;
*/
export class FASTAnchor extends FASTElement {
/**
* Prompts the user to save the linked URL. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element } for more information.
* Prompts the user to save the linked URL.
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element } for more information.
* @public
* @remarks
* HTML Attribute: download
Expand All @@ -33,7 +34,8 @@ export class FASTAnchor extends FASTElement {
public download: string;

/**
* The URL the hyperlink references. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element } for more information.
* The URL the hyperlink references.
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element } for more information.
* @public
* @remarks
* HTML Attribute: href
Expand All @@ -42,7 +44,8 @@ export class FASTAnchor extends FASTElement {
public href: string;

/**
* Hints at the language of the referenced resource. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element } for more information.
* Hints at the language of the referenced resource.
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element } for more information.
* @public
* @remarks
* HTML Attribute: hreflang
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ test.describe("Breadcrumb", () => {
).toHaveAttribute("aria-current", "page");
});

/* eslint-disable-next-line max-len */
test("should remove `aria-current` from any prior breadcrumb item children with child anchors when a new node is appended", async () => {
await root.evaluate(node => {
node.innerHTML = /* html */ `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ test.describe("Calendar", () => {
).toBe("1942 शक");
});

/* eslint-disable-next-line max-len */
test('should set the formatted `year` property to "2564" when the `year` attribute is "2021" for the Buddhist calendar', async () => {
await root.evaluate(node => {
node.innerHTML = /* html */ `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ test.describe("Checkbox", () => {
await expect(element).toHaveJSProperty("checked", true);
});

/* eslint-disable-next-line max-len */
test("should put the control into a clean state, where checked attribute modifications change the checked property prior to user or programmatic interaction", async () => {
await root.evaluate(node => {
node.innerHTML = /* html */ `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ test.describe("DesignTokenNode", () => {

expect(node.getTokenValue(token)).toEqual(12);
});
/* eslint-disable-next-line max-len */
test("should resolve a static value from an ancestor node assigned a static value when the descendent node does not have the token assigned a value", () => {
const token = new DesignToken<number>();
const ancestor = createNode();
Expand All @@ -354,6 +355,7 @@ test.describe("DesignTokenNode", () => {

expect(descendent.getTokenValue(token)).toEqual(12);
});
/* eslint-disable-next-line max-len */
test("should resolve a static value from an ancestor node assigned a derived value when the descendent node does not have the token assigned a value", () => {
const token = new DesignToken<number>();
const ancestor = createNode();
Expand Down Expand Up @@ -589,6 +591,7 @@ test.describe("DesignTokenNode", () => {
);
expect(() => node.getTokenValue(token)).toThrow();
});
/* eslint-disable-next-line max-len */
test("the token with the node that has a token assigned a derived value and a dependency of the derived value changes for the node", () => {
const token = new DesignToken<number>();
const dependency = new DesignToken<number>();
Expand Down Expand Up @@ -618,6 +621,7 @@ test.describe("DesignTokenNode", () => {
);
expect(node.getTokenValue(token)).toEqual(14);
});
/* eslint-disable-next-line max-len */
test("the token with the descendent node that has a token assigned a static value that is a dependency of a value assigned for an ancestor", () => {
const token = new DesignToken<number>();
const dependency = new DesignToken<number>();
Expand Down Expand Up @@ -651,6 +655,7 @@ test.describe("DesignTokenNode", () => {
expect(parent.getTokenValue(token)).toEqual(12);
expect(descendent.getTokenValue(token)).toEqual(14);
});
/* eslint-disable-next-line max-len */
test("the token with the descendent node that has a token assigned a derived value that is a dependency of a value assigned for an ancestor", () => {
const token = new DesignToken<number>();
const dependency = new DesignToken<number>();
Expand Down Expand Up @@ -684,6 +689,7 @@ test.describe("DesignTokenNode", () => {
expect(parent.getTokenValue(token)).toEqual(12);
expect(descendent.getTokenValue(token)).toEqual(14);
});
/* eslint-disable-next-line max-len */
test("the token with the descendent node that has a token reassigned a static value that is a dependency of a value assigned for an ancestor", () => {
const token = new DesignToken<number>();
const dependency = new DesignToken<number>();
Expand Down Expand Up @@ -718,6 +724,7 @@ test.describe("DesignTokenNode", () => {
expect(parent.getTokenValue(token)).toEqual(12);
expect(descendent.getTokenValue(token)).toEqual(16);
});
/* eslint-disable-next-line max-len */
test("the token with the descendent node that has a token reassigned a derived value that is a dependency of a value assigned for an ancestor", () => {
const token = new DesignToken<number>();
const dependency = new DesignToken<number>();
Expand Down Expand Up @@ -752,6 +759,7 @@ test.describe("DesignTokenNode", () => {
expect(parent.getTokenValue(token)).toEqual(12);
expect(descendent.getTokenValue(token)).toEqual(16);
});
/* eslint-disable-next-line max-len */
test("the token with a descendent node when a ancestor and descendent both have a dependency assigned and the ancestor is reassigned a token to a derived value that resolves the dependency and results in a value change", () => {
const token = new DesignToken<number>();
const dependency = new DesignToken<number>();
Expand Down Expand Up @@ -795,6 +803,7 @@ test.describe("DesignTokenNode", () => {
expect(parent.getTokenValue(token)).toEqual(10);
expect(descendent.getTokenValue(token)).toEqual(14);
});
/* eslint-disable-next-line max-len */
test("the token with the descendent node that has a token assigned a static value deleted that is a dependency of a value assigned for an ancestor", () => {
const token = new DesignToken<number>();
const dependency = new DesignToken<number>();
Expand Down Expand Up @@ -827,6 +836,7 @@ test.describe("DesignTokenNode", () => {
expect(parent.getTokenValue(token)).toEqual(12);
expect(descendent.getTokenValue(token)).toEqual(12);
});
/* eslint-disable-next-line max-len */
test("the token with the descendent node that has a token assigned a derived value deleted that is a dependency of a value assigned for an ancestor", () => {
const token = new DesignToken<number>();
const dependency = new DesignToken<number>();
Expand Down Expand Up @@ -859,6 +869,7 @@ test.describe("DesignTokenNode", () => {
expect(parent.getTokenValue(token)).toEqual(12);
expect(descendent.getTokenValue(token)).toEqual(12);
});
/* eslint-disable-next-line max-len */
test("should the token for ancestor, parent, and descendent nodes when parent and descendent are assigned a value that depends on the token and the ancestor's value is changed", () => {
const token = new DesignToken<number>();
const ancestor = createNode();
Expand Down Expand Up @@ -914,6 +925,7 @@ test.describe("DesignTokenNode", () => {
/**
* Appending nodes
*/
/* eslint-disable-next-line max-len */
test("the token with the descendent node that has a dependency assigned when the node is appended to an ancestor with a derived value assigned that depends on the dependency", () => {
const ancestor = createNode();
const parent = createNode(ancestor);
Expand Down Expand Up @@ -947,6 +959,7 @@ test.describe("DesignTokenNode", () => {
/**
* Removing nodes
*/
/* eslint-disable-next-line max-len */
test("the token with the descendent node that has a dependency assigned when the node is appended to an ancestor with a derived value assigned that depends on the dependency and is then removed", () => {
const ancestor = createNode();
const parent = createNode(ancestor);
Expand Down Expand Up @@ -980,6 +993,7 @@ test.describe("DesignTokenNode", () => {
/**
* Moving node
*/
/* eslint-disable-next-line max-len */
test("the token with the descendent node that has a dependency assigned when the node is re-parented to an ancestor with a different derived value assigned that depends on the dependency", () => {
const ancestorA = createNode();
const ancestorB = createNode();
Expand Down Expand Up @@ -1013,6 +1027,7 @@ test.describe("DesignTokenNode", () => {
);
expect(descendent.getTokenValue(token)).toEqual(21);
});
/* eslint-disable-next-line max-len */
test("should support reparenting a node with a derived token assigned to a tree where the immediate parent doesn't not have the dependency assigned", () => {
const ancestor = new DesignTokenNode();
const parent = new DesignTokenNode();
Expand Down Expand Up @@ -1062,6 +1077,7 @@ test.describe("DesignTokenNode", () => {
)
);
});
/* eslint-disable-next-line max-len */
test("the token with the ancestor and descendent node when the ancestor is assigned a derived value using an observable and a token, where both nodes contain a value set for the dependency", () => {
const ancestor = createNode();
const parent = createNode(ancestor);
Expand Down Expand Up @@ -1121,6 +1137,7 @@ test.describe("DesignTokenNode", () => {

expect(handleChange).not.toHaveBeenCalled();
});
/* eslint-disable-next-line max-len */
test("the token when the derived value assigned to a node results in the same value as the previously assigned static value", () => {
const token = new DesignToken<number>();
const node = new DesignTokenNode();
Expand All @@ -1132,6 +1149,7 @@ test.describe("DesignTokenNode", () => {

expect(handleChange).not.toHaveBeenCalled();
});
/* eslint-disable-next-line max-len */
test("the token when the derived value assigned to a node results in the same value as the previously assigned derived value", () => {
const token = new DesignToken<number>();
const node = new DesignTokenNode();
Expand All @@ -1152,7 +1170,7 @@ test.describe("DesignTokenNode", () => {
expect(a).not.toEqual(b);
expect(handleChange).not.toHaveBeenCalled();
});

/* eslint-disable-next-line max-len */
test("the token when a dependency of a derived token value is set for a descendent but there is an intermediary value set that is a static value", () => {
const token = new DesignToken<number>();
const dependency = new DesignToken<number>();
Expand All @@ -1170,6 +1188,7 @@ test.describe("DesignTokenNode", () => {
expect(handleChange).not.toHaveBeenCalled();
expect(child.getTokenValue(token)).toEqual(25);
});
/* eslint-disable-next-line max-len */
test.skip("the token when a dependency of a derived token value is set for a descendent but there is an intermediary value set that is a derived value that does not depend on the dependent token", () => {
const token = new DesignToken<number>();
const dependency = new DesignToken<number>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class DerivedValueEvaluator<T> {
}

throw new Error(
/* eslint-disable-next-line max-len */
"DesignTokenNode has encountered a circular token reference. Avoid this by setting the token value for an ancestor node."
);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ test.describe("A DesignToken", () => {
})
).toBe("12");
});
/* eslint-disable-next-line max-len */
test("should set a CSS custom property equal to the resolved value of a derived token value with a dependent token", async () => {
expect(
await page.evaluate(async () => {
Expand All @@ -516,7 +517,7 @@ test.describe("A DesignToken", () => {
})
).toBe("12");
});

/* eslint-disable-next-line max-len */
test("should update a CSS custom property to the resolved value of a derived token value with a dependent token when the dependent token changes", async () => {
expect(
await page.evaluate(async () => {
Expand Down Expand Up @@ -547,7 +548,7 @@ test.describe("A DesignToken", () => {
})
).toEqual(["12", "14"]);
});

/* eslint-disable-next-line max-len */
test("should set a CSS custom property equal to the resolved value for an element of a derived token value with a dependent token", async () => {
expect(
await page.evaluate(async () => {
Expand Down Expand Up @@ -577,7 +578,7 @@ test.describe("A DesignToken", () => {
})
).toEqual(["12", "14"]);
});

/* eslint-disable-next-line max-len */
test("should set a CSS custom property equal to the resolved value for an element in a shadow DOM of a derived token value with a dependent token", async () => {
expect(
await page.evaluate(async () => {
Expand Down Expand Up @@ -609,7 +610,7 @@ test.describe("A DesignToken", () => {
})
).toEqual(["12", "14"]);
});

/* eslint-disable-next-line max-len */
test("should set a CSS custom property equal to the resolved value for both elements for which a dependent token is set when setting a derived token value", async () => {
expect(
await page.evaluate(async () => {
Expand Down Expand Up @@ -831,6 +832,7 @@ test.describe("A DesignToken", () => {
})
).toEqual(["12", "14"]);
});
/* eslint-disable-next-line max-len */
test("should update the emitted CSS custom property of a token assigned a derived value when the token dependency changes", async () => {
expect(
await page.evaluate(async () => {
Expand Down Expand Up @@ -885,6 +887,7 @@ test.describe("A DesignToken", () => {
).toEqual([12, 24]);
});
});
/* eslint-disable-next-line max-len */
test("should update the CSS custom property of a derived token with a dependency that is a derived token that depends on a third token", async () => {
expect(
await page.evaluate(async () => {
Expand Down Expand Up @@ -1343,6 +1346,7 @@ test.describe("A DesignToken", () => {
})
).toBe(1);
});
/* eslint-disable-next-line max-len */
test("should notify a subscriber when a static-value dependency of subscribed token changes for a parent of the subscription target", async () => {
expect(
await page.evaluate(async () => {
Expand Down Expand Up @@ -1372,6 +1376,7 @@ test.describe("A DesignToken", () => {
})
).toEqual([1, 14]);
});
/* eslint-disable-next-line max-len */
test("should notify a subscriber when a derived-value dependency of subscribed token changes for a parent of the subscription target", async () => {
expect(
await page.evaluate(async () => {
Expand Down Expand Up @@ -1400,6 +1405,7 @@ test.describe("A DesignToken", () => {
})
).toEqual([1, 14]);
});
/* eslint-disable-next-line max-len */
test("should notify a subscriber when a dependency of subscribed token changes for a parent of the subscription target", async () => {
expect(
await page.evaluate(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { DividerOrientation, DividerRole } from "./divider.options.js";

/**
* A Divider Custom HTML Element.
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#separator | ARIA separator } or {@link https://www.w3.org/TR/wai-aria-1.1/#presentation | ARIA presentation}.
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#separator | ARIA separator }
* or {@link https://www.w3.org/TR/wai-aria-1.1/#presentation | ARIA presentation}.
*
* @public
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export type FlipperOptions = {
* @slot previous - The previous flipper content
* @csspart next - Wraps the next flipper content
* @csspart previous - Wraps the previous flipper content
* @fires click - Fires a custom 'click' event when Enter or Space is invoked via keyboard and the flipper is exposed to assistive technologies.
* @fires click - Fires a custom 'click' event when Enter or Space is invoked via keyboard
* and the flipper is exposed to assistive technologies.
*
* @public
*/
Expand All @@ -36,7 +37,8 @@ export class FASTFlipper extends FASTElement {
public disabled: boolean;

/**
* Indicates the flipper should be hidden from assistive technology. Because flippers are often supplementary navigation, they are often hidden from assistive technology.
* Indicates the flipper should be hidden from assistive technology.
* Because flippers are often supplementary navigation, they are often hidden from assistive technology.
*
* @public
* @defaultValue - true
Expand Down
Loading

0 comments on commit c002514

Please sign in to comment.