Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web-components): update second half of web-components files to resolve strict mode errors #3329

Open
wants to merge 2 commits into
base: v3.0.0/develop
Choose a base branch
from

Conversation

GCHQ-Developer-847
Copy link
Contributor

@GCHQ-Developer-847 GCHQ-Developer-847 commented Mar 16, 2025

Summary of the changes

Update second half of the web-components files to resolve strict mode errors (first half has been completed: #3328). Also added some unit tests as the changes brought the coverage below 80%.

Update: also added a new IcMultiValueEventDetail type to resolve ticket #3349 (have updated ic-select + ic-menu files to use this, and also one instance in ic-search-bar, as it uses ic-menu).

I have added the non-null assertion operator (!) after some variables. This is because those variables are component props which have a default value; the TypeScript strict mode checking doesn't seem to detect that these default values exist.


I will create a separate PR to actually enable TypeScript mode. (Enabling TypeScript mode causes | undefined to be added to every optional prop in the component readme files - want to avoid loads of changes in this PR so GitHub doesn't become really slow when viewing them).

Related issue

#266

Checklist

General

  • Changes to docs package checked and committed.
  • All acceptance criteria reviewed and met.

Testing

  • Relevant unit tests and visual regression tests added.
  • Visual testing against Figma component specification completed.
  • Playground stories in React Storybook up to date, with any prop changes and additions addressed.
  • Compare performance of modified components against develop using Performance addon in React Storybook.

Accessibility

  • Accessibility Insights FastPass performed.
  • A11y unit test added and yields no issues.
  • A11y plug-in on Storybook yields no issues.
  • Manual screen reader testing performed using NVDA and VoiceOver.
  • Manual keyboard testing for keyboard controls and logical focus order.
  • Correct roles used and ARIA attributes used correctly where required.
  • Logical heading structure is maintained, and the HTML elements used for headings can be changed to fit within the wider page structure.

Resize/zoom behaviour

  • Page can be zoomed to 400% with no loss of content.
  • Screen magnifier used with no issues.
  • Text resized to 200% with no loss of content.
  • Text spacing increased as per the WCAG 1.4.12 success criterion with no loss of content.

System modes

  • Browser setting 'prefers reduced motion' tested. No animations or motion visible whilst this setting is on.
  • Windows High Contrast mode tested with no loss of content.
  • System light and dark mode tested with no loss of content.
  • Browser support tested (Chrome, Safari, Firefox and Edge).

Testing content extremes

  • Min/max content examples tested with no loss of content or overflow.
  • All prop combinations work without issue.
  • Tested for FOUC (Flash of Unstyled Content) in both SSR (Server-Side Rendering) and SSG (Static Site Generation) settings.
  • Controlled and uncontrolled input components tested.
  • Props/slots can be updated after initial render.

Copy link
Contributor

@GCHQ-Developer-847 GCHQ-Developer-847 changed the title Feat/266 enable typescript strict mode 2 feat(web-components): update second half of web-components files to resolve strict mode errors Mar 17, 2025
@GCHQ-Developer-847 GCHQ-Developer-847 force-pushed the feat/266-enable-typescript-strict-mode-2 branch 2 times, most recently from da0b9bc to d742e45 Compare March 20, 2025 15:41
@GCHQ-Developer-847 GCHQ-Developer-847 marked this pull request as ready for review March 20, 2025 16:36
@GCHQ-Developer-847 GCHQ-Developer-847 force-pushed the feat/266-enable-typescript-strict-mode-2 branch 2 times, most recently from 0678151 to 0077405 Compare March 21, 2025 12:10
@mi6 mi6 deleted a comment from github-actions bot Mar 21, 2025
@GCHQ-Developer-847 GCHQ-Developer-847 force-pushed the feat/266-enable-typescript-strict-mode-2 branch from 0077405 to d0d09f8 Compare March 24, 2025 14:20
…esolve strict mode errors

Make changes throughout remaining half of web-components files to resolve strict mode errors
(plus some existing warnings). (Strict mode to be actually enabled in a separate commit / PR).
Add unit tests to increase test coverage because the strict mode changes took it under 80%.
Update select + menu + search bar files to use new IcMultiValueEventDetail type.

.#266 and #3349
…cond half of web-comps files)

Update docs to reflect TypeScript strict mode changes (second half of web-components files).

.#266
@GCHQ-Developer-847 GCHQ-Developer-847 force-pushed the feat/266-enable-typescript-strict-mode-2 branch from d0d09f8 to 960640c Compare March 24, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants