Skip to content

Restructure HTML tests#5311

Merged
compulim merged 17 commits intomicrosoft:mainfrom
compulim:feat-html2-test
Sep 26, 2024
Merged

Restructure HTML tests#5311
compulim merged 17 commits intomicrosoft:mainfrom
compulim:feat-html2-test

Conversation

@compulim
Copy link
Copy Markdown
Contributor

@compulim compulim commented Sep 26, 2024

Changelog Entry

(No changelog for test infrastructure changes.)

Description

Streamlining DX for writing tests.

Design

  • Snapshot located side-by-side with test files
    • Diff snapshot also located side-by-side
  • No need to write .js entrypoint file
    • Also lacking the ability to have a single .js running .html multiple times with different arguments, need to think how to make this better
  • Separating jest.config.js as html and html2 tests has conflicting changes
    • Mainly, html2 requires test environment to be set inside jest.config.js due to limitation on Jest side

Specific Changes

  • Added new Jest test transformer for "html2" tests for "entrypoint-less" tests
  • Added new argument host.snapshot('local') to place the snapshot side-by-side to the test file
  • Moved preChat* tests to "html2"
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@compulim compulim marked this pull request as ready for review September 26, 2024 09:46
Comment thread __tests__/html2/fluentTheme/preChatMessageActivity/simple.html
Copy link
Copy Markdown
Collaborator

@OEvgeny OEvgeny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks cool!

Comment thread html2-test-transformer.js
@compulim compulim merged commit be287d7 into microsoft:main Sep 26, 2024
@compulim compulim deleted the feat-html2-test branch September 26, 2024 17:09
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