@adobe/spectrum-tokens 14.4.0 → 14.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,10 +20,12 @@ test("ensure all component tokens are have component data", async (t) => {
20
20
  ...(await getFileTokens("icons.json")),
21
21
  };
22
22
  const result = Object.keys(tokenData).filter((tokenName) => {
23
- return (
24
- !Object.hasOwn(tokenData[tokenName], "component") ||
25
- tokenName.indexOf(tokenData[tokenName].component) != 0
26
- );
23
+ const component = tokenData[tokenName].component;
24
+ if (!component) return true;
25
+ // Spec-order names may have a variant prefix before the component,
26
+ // so check that the component appears in the name rather than
27
+ // requiring it at position 0.
28
+ return !tokenName.includes(component);
27
29
  });
28
30
  t.deepEqual(result, []);
29
31
  });