refactor: decouple mock API data into separate fixtures file and upda… - #396
Merged
Lakes41 merged 1 commit intoAug 19, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closed #389
Description
This PR refactors the frontend mock database by decoupling static data fixtures from the mock API behavior. It also fixes several UI/UX bugs in the Admin Settings dashboard, resolving malformed component structures and fixing broken toast notification bindings.
Type of Change
Changes Made
lib/api/mock/fixtures.ts: [New File] Extracted all static mock fixtures (members, resources, policies, communities, webhook events, and seed naming pools) into a dedicated file.lib/api/mock.ts: Refactored to import static fixtures rather than declaring them inline, drastically simplifying the file and strictly separating state mutation behavior from data.app/[communitySlug]/admin/settings/page.tsx:<Card>component and a duplicatedWorkflow & Approvalssection.useToasts()hook usage by properly destructuringtoastsanddismissToast.toastsandonDismissprops to the<ToastViewport />component to prevent invisible toast errors.addToastoptions to use the validtoneproperty instead ofvariant.test/pending-actions.test.ts: Fixed severe test file corruption (duplicated imports and redefined block-scoped variables) that was failing the test suite.Screenshots / Recordings
Test Evidence
NEXT_PUBLIC_MOCK_MODE=true)guildpass-core(if applicable)Checklist
npm run typecheckpassesnpm run lintpasses.env.exampleupdated if new environment variables were addedAdditional Notes
The Typescript configuration deprecation warnings from TS 5.x were also suppressed in the root and test
tsconfig.jsonfiles to ensure a cleaner build output pipeline.