-
Notifications
You must be signed in to change notification settings - Fork 34
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
No longer adds start attribute to unordered lists #1901
Merged
FrenjaminBanklin
merged 6 commits into
ucfopen:dev/30-howlite
from
walid-i:issue/1279-no-start-element
Feb 27, 2023
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8b67e51
No longer adds start attribute to unordered lists
dafd479
remove extra comment line for code clean up
RachelDau 999f245
snapshot update u
RachelDau 5d4b033
unit tests for unordered and ordered lists having/ not having start a…
RachelDau d23e76d
unit tests update to test lists properly
RachelDau 1933293
unit tests update again
RachelDau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
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.
Given the expectation for
ls.type
to be one or the other, these conditions are unnecessary. In a worst-case scenario, not that I know how this might happen, this conditional could allow the test to pass even if the expectations are not met, since the expectations might not be checked at all.Also this is just nitpicking, but if
unordered
is the default behavior, I would keep a test where it is not set (to make sure it's the default behavior) and also a separate test explicitly setting 'unordered' to make sure everything still reacts properly.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.
I made these changes and took a closer look at the unit test for ordered which was filing with the removal of the condition. I learned
ls.init()
sets the style to unordered so I removed this line. I addedls.get(indent)
as it calls other functions that seem to set up the list including adding the start attribute if it is ordered. I think this function would be called to create a list with defaults so I think it is a better way to test that these three unit tests function properly.A start attribute is not automatically added when
const ls = new ListStyles('ordered')
is created so this test was failing before I calledls.get(indent)
which returnsgetStyleWithDefaults(indent, this.type, this.styles[indent])
as seen inlist-styles.js