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

Editor: Display an item in Table of Contents when only one heading added #3648

Merged
merged 1 commit into from Nov 24, 2017

Conversation

Projects
None yet
2 participants
@gziolo
Member

gziolo commented Nov 24, 2017

Description

You need to add at least 2 heading to the document to see them listed in the table of contents. This PR tries to fix that. It also adds unit tests which will prevent regression in the future.

How Has This Been Tested?

Manually + newly created unit tests.

Screenshots (jpeg or gifs if applicable):

Before

screen shot 2017-11-24 at 13 55 18

After

screen shot 2017-11-24 at 14 37 14

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows has proper inline documentation.

@gziolo gziolo self-assigned this Nov 24, 2017

@gziolo gziolo requested review from karmatosed, mtias and jasmussen Nov 24, 2017

@codecov

This comment has been minimized.

Show comment
Hide comment
@codecov

codecov bot Nov 24, 2017

Codecov Report

Merging #3648 into master will increase coverage by 0.24%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3648      +/-   ##
==========================================
+ Coverage   36.91%   37.15%   +0.24%     
==========================================
  Files         275      275              
  Lines        6629     6629              
  Branches     1201     1202       +1     
==========================================
+ Hits         2447     2463      +16     
+ Misses       3530     3517      -13     
+ Partials      652      649       -3
Impacted Files Coverage Δ
editor/components/document-outline/index.js 75% <100%> (+57.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 78db139...c066e63. Read the comment docs.

codecov bot commented Nov 24, 2017

Codecov Report

Merging #3648 into master will increase coverage by 0.24%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3648      +/-   ##
==========================================
+ Coverage   36.91%   37.15%   +0.24%     
==========================================
  Files         275      275              
  Lines        6629     6629              
  Branches     1201     1202       +1     
==========================================
+ Hits         2447     2463      +16     
+ Misses       3530     3517      -13     
+ Partials      652      649       -3
Impacted Files Coverage Δ
editor/components/document-outline/index.js 75% <100%> (+57.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 78db139...c066e63. Read the comment docs.

@mtias

mtias approved these changes Nov 24, 2017

I approve the change.

@gziolo gziolo merged commit bccede6 into master Nov 24, 2017

3 checks passed

codecov/project 37.15% (+0.24%) compared to 78db139
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@gziolo gziolo deleted the fix/document-outline-tests branch Nov 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment