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

Fix client-admin SignOut story #26

Open
patcon opened this issue Oct 26, 2024 · 0 comments
Open

Fix client-admin SignOut story #26

patcon opened this issue Oct 26, 2024 · 0 comments

Comments

@patcon
Copy link
Member

patcon commented Oct 26, 2024

Getting an error for this:

http://civictechto.github.io/polis-storybook?path=/story/compdem-client-admin-signout--default

TypeError: Failed to construct 'URL': Invalid URL
    at Function.ajax (http://localhost:6006/main.iframe.bundle.js:322:32)
    at signoutPost (http://localhost:6006/_storybook_decorators_js.iframe.bundle.js:914:58)
    at http://localhost:6006/_storybook_decorators_js.iframe.bundle.js:924:16
    at Object.dispatch (http://localhost:6006/vendors-node_modules_theme-ui_theme-provider_dist_index_esm_js-node_modules_react-redux_es_in-8925c8.iframe.bundle.js:5486:18)
    at SignOut.componentDidMount (http://localhost:6006/compdem-client-admin-SignOut-stories.iframe.bundle.js:306:20)
    at commitLifeCycles (http://localhost:6006/vendors-node_modules_storybook_addon-a11y_dist_preview_mjs-node_modules_storybook_addon-essen-e6ba31.iframe.bundle.js:64765:22)
    at commitLayoutEffects (http://localhost:6006/vendors-node_modules_storybook_addon-a11y_dist_preview_mjs-node_modules_storybook_addon-essen-e6ba31.iframe.bundle.js:67754:7)
    at HTMLUnknownElement.callCallback (http://localhost:6006/vendors-node_modules_storybook_addon-a11y_dist_preview_mjs-node_modules_storybook_addon-essen-e6ba31.iframe.bundle.js:45139:14)
    at Object.invokeGuardedCallbackDev (http://localhost:6006/vendors-node_modules_storybook_addon-a11y_dist_preview_mjs-node_modules_storybook_addon-essen-e6ba31.iframe.bundle.js:45188:16)
    at invokeGuardedCallback (http://localhost:6006/vendors-node_modules_storybook_addon-a11y_dist_preview_mjs-node_modules_storybook_addon-essen-e6ba31.iframe.bundle.js:45243:31)

Seems to be related to this:

const mockedPathname = new URL(params.url).pathname

but can't make it go away by adding a new entry to this for /api/v3/auth/deregister to this:

global.$.ajax = ajax_responses({
'/api/v3/math/pca2': getMath(),
'/api/v3/comments': [getComments()],
'/api/v3/votes': [],
'/api/v3/votes/famous': getVotesFamous(),
})

related to this action being run in <SignOut />

https://github.com/CivicTechTO/polis/blob/24604e5fa1a1e32357b18237b33510c26d3bd3fb/client-admin/src/actions/index.js#L612-L620

Needs troubleshooting

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

No branches or pull requests

1 participant