Skip to content

[tests] Make add-org interactive test catch config creation regressions#1061

Open
czarflix wants to merge 1 commit into
openwisp:masterfrom
czarflix:issue-880-add-org-interactive-test
Open

[tests] Make add-org interactive test catch config creation regressions#1061
czarflix wants to merge 1 commit into
openwisp:masterfrom
czarflix:issue-880-add-org-interactive-test

Conversation

@czarflix
Copy link
Copy Markdown
Contributor

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Closes #880.

Description of Changes

The existing interactive add-org test was only a smoke test, so commenting out
createConfiguration(response) in createConfigurationWithPrompts() still left
the focused test suite green.

This updates config/__tests__/add-org.test.js to add a regression test that:

  • runs the interactive CLI path with mocked prompt answers
  • checks that the organization config file is created
  • verifies key YAML fields from the prompt data

The existing smoke test is kept and no application code is changed.

Verification

  • yarn jest config/__tests__/add-org.test.js --runInBand
  • ./run-qa-checks
  • confirmed the new test fails if createConfiguration(response) is commented out
  • yarn test --runInBand was compared against untouched origin/master; the observed login/header failures are preexisting and unrelated to this change

Screenshot

N/A - test-only change

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 15, 2026

Warning

Rate limit exceeded

@czarflix has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 14 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: adaff9f5-c63c-48e9-a6df-5309fdf76e7e

📥 Commits

Reviewing files that changed from the base of the PR and between c2813c5 and 9d59781.

📒 Files selected for processing (1)
  • config/__tests__/add-org.test.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Add a regression test for the successful interactive add-org flow so the suite fails when config creation is skipped.

Closes openwisp#880
@czarflix czarflix changed the title [test] Make add-org interactive test catch config creation regressions [tests] Make add-org interactive test catch config creation regressions Mar 15, 2026
@czarflix czarflix force-pushed the issue-880-add-org-interactive-test branch from 984fb1d to 9d59781 Compare March 15, 2026 03:27
@czarflix
Copy link
Copy Markdown
Contributor Author

Hi @nemesifier , please take a look when you have the time

@czarflix
Copy link
Copy Markdown
Contributor Author

@nemesifier , ready for review when you have the time

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.

[test] Make add-org automated more robust: interactive input

1 participant