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

Refactor generateToc tests to use normal project structure #1267

Merged
merged 1 commit into from
May 1, 2024

Conversation

Eric-Arellano
Copy link
Collaborator

This is to unblock #1249. We now use the project folder that Pkg.mock().outputDir() would use.

This also removes inline snapshots. They can't be updated via npm test -- -u due to Prettier, so it's more helpful to use a normal expect().toEqual().

...DEFAULT_ARGS,
},
]);

expect(toc).toMatchInlineSnapshot(`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Only the page names and URLs changed in this diff

Comment on lines +185 to +189
{
moduleId: "my_quantum_project.another",
title: "dedicated module",
kind: "module",
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a new test because once we have #1249, we couldn't be confident that putting the API index page in the title came from our grouping code rather than the new ensureIndexPage().

isReleaseNotes: true,
},
],
);

expect(toc).toMatchInlineSnapshot(`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No changes made other than URLs and page titles

Copy link
Member

@frankharkins frankharkins left a comment

Choose a reason for hiding this comment

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

Thanks!

@Eric-Arellano Eric-Arellano added this pull request to the merge queue May 1, 2024
Merged via the queue into main with commit 7b9a194 May 1, 2024
2 checks passed
@Eric-Arellano Eric-Arellano deleted the EA/refactor-toc-tests branch May 1, 2024 15:24
frankharkins pushed a commit to frankharkins/documentation that referenced this pull request Jul 22, 2024
This is to unblock Qiskit#1249.
We now use the project folder that `Pkg.mock().outputDir()` would use.

This also removes inline snapshots. They can't be updated via `npm test
-- -u` due to Prettier, so it's more helpful to use a normal
`expect().toEqual()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants