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

STCOR-913 Don't override initial discovery and okapi data in test mocks #1564

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

BogdanDenis
Copy link
Contributor

@BogdanDenis BogdanDenis commented Nov 21, 2024

Description

Updating stripes-core in SSC causes 30+ tests to fail. folio-org/stripes-smart-components#1538
This PR addresses some issues which cause these failures.

  1. StrictMode. Using StrictMode makes components render twice to check for mutation, which makes some components receive test data twice, render twice etc. For now the fix is only hardcoded. Need to be able to pass disableStrictMode flag to karma tests <StrictMode> Addressed in STCLI-256 turn off StrictMode when running tests stripes-cli#363 instead.
  2. Overwriting of initial okapi and discovery data in setupApplication helper. Some tests require custom okapi data, but setupApplication in some cases can overwrite that data which makes those tests fail.
  3. ? Still investigating a few failing tests so maybe there's something else that needs to be fixed.

Refs STCOR-913

Copy link

github-actions bot commented Nov 21, 2024

Bigtest Unit Test Results

192 tests  ±0   187 ✅ ±0   6s ⏱️ -1s
  1 suites ±0     5 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 1fbb033. ± Comparison against base commit 943d67a.

This pull request removes 5 and adds 3 tests. Note that renamed tests count towards both.
      equal to check email label in english translation
      equal to check email precautions label in english translation
      equal to sent email precautions label in english translation
Chrome_131_0_0_0_(Linux_x86_64).Forgot username/password status test check email status page tests ‑ Forgot username/password status test check email status page tests should have the header with an appropriate text content
Chrome_131_0_0_0_(Linux_x86_64).Forgot username/password status test check email status page tests ‑ Forgot username/password status test check email status page tests should have the paragraph with an appropriate text content
Chrome_131_0_0_0_(Linux_x86_64).Forgot username/password status test check email status page tests ‑ Forgot username/password status test check email status page tests should have the header with an appropriate text content
      equal to check email label in english translation
Chrome_131_0_0_0_(Linux_x86_64).Forgot username/password status test check email status page tests ‑ Forgot username/password status test check email status page tests should have the paragraph with an appropriate text content
      equal to check email precautions label in english translation
Chrome_131_0_0_0_(Linux_x86_64).Forgot username/password status test check email status page tests ‑ Forgot username/password status test check email status page tests should have the paragraph with an appropriate text content
      equal to sent email precautions label in english translation

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Nov 21, 2024

Jest Unit Test Results

  1 files  ±0   55 suites  ±0   1m 30s ⏱️ -4s
348 tests ±0  348 ✅ ±0  0 💤 ±0  0 ❌ ±0 
351 runs  ±0  351 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 1fbb033. ± Comparison against base commit 943d67a.

♻️ This comment has been updated with latest results.

@BogdanDenis BogdanDenis force-pushed the dont-override-initial-okapi-data-in-tests branch from ae4a6d0 to 51abc5b Compare November 21, 2024 15:08
@zburke zburke changed the title Don't override initial discovery and okapi data in test mocks. Disable StrictMode in tests. STCOR-913 Don't override initial discovery and okapi data in test mocks Nov 21, 2024
@zburke zburke merged commit 1c73afd into master Nov 21, 2024
16 checks passed
@zburke zburke deleted the dont-override-initial-okapi-data-in-tests branch November 21, 2024 18:14
zburke pushed a commit that referenced this pull request Dec 2, 2024
…ks (#1564)

Updating `stripes-core` in SSC causes 30+ tests to fail.
folio-org/stripes-smart-components#1538
This PR addresses some issues which cause these failures.

Overwriting of initial okapi and discovery data in `setupApplication`
helper. Some tests require custom okapi data, but `setupApplication` in
some cases can overwrite that data which makes those tests fail.

Still investigating a few failing tests so maybe there's something
else that needs to be fixed.

(cherry picked from commit 1c73afd)
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.

3 participants