-
Notifications
You must be signed in to change notification settings - Fork 113
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
Extend HTML mode - persist checkbox value and use across views #135
base: master
Are you sure you want to change the base?
Extend HTML mode - persist checkbox value and use across views #135
Conversation
@@ -1,5 +1,7 @@ | |||
import Code from "@/components/Code.vue"; | |||
import { shallowMount } from "@vue/test-utils"; | |||
import store from "@/store"; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1,5 +1,7 @@ | |||
import Code from "@/components/Code.vue"; | |||
import { shallowMount } from "@vue/test-utils"; | |||
import store from "@/store"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bit needs to be actually used.
Also please run tests and fix them. The Code component needs to switch between HTML and Markdown mode in the tests.
This file is failing.
This old code is like this:
data() {
return {
asHtml: true,
};
},
I tried adding this and it didn't work.
wrapper.setData({ asHtml: true })
store.setAsHtml(true)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix failing tests
…o feature-issue-101
Also a problem I found is that the checkbox only syncs across views - I'd like it to sync within the Catalogue view across checkboxes. So maybe the asHtml boolean is passed in as a prop to the component. That will make the tests easier. I tried this global approach but had errors |
Thanks for noticing those! I will give you a fix as soon as I finish them. |
https://github.com/MichaelCurrin/badge-generator/blob/master/docs/usage.md#tests Or on Windows
Also note the checks at the bottom of the conversation with green ticks and then a red cross for the failing tests on GitHub Actions |
Let me know if you need more info to complete this. Thanks. |
This PR is an additional feature to issue #101.
Created method to store asHtml in store.ts and use that value in Code.vue.
If you check/uncheck the Html checkbox in one view, it applies to all other views.