-
Notifications
You must be signed in to change notification settings - Fork 125
Move extendedDocLink creation to ModelElementRenderer #2085
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,9 @@ import 'dart:io'; | |
import 'package:dartdoc/dartdoc.dart'; | ||
import 'package:dartdoc/src/model/model.dart'; | ||
import 'package:dartdoc/src/render/category_renderer.dart'; | ||
import 'package:dartdoc/src/render/parameter_renderer.dart'; | ||
import 'package:dartdoc/src/render/enum_field_renderer.dart'; | ||
import 'package:dartdoc/src/render/model_element_renderer.dart'; | ||
import 'package:dartdoc/src/render/parameter_renderer.dart'; | ||
import 'package:dartdoc/src/render/typedef_renderer.dart'; | ||
import 'package:dartdoc/src/warnings.dart'; | ||
import 'package:test/test.dart'; | ||
|
@@ -584,7 +585,7 @@ void main() { | |
expect( | ||
fakeLibrary.oneLineDoc, | ||
equals( | ||
'WOW FAKE PACKAGE IS <strong>BEST</strong> <a href="http://example.org">PACKAGE</a> <a href="fake/fake-library.html">[...]</a>')); | ||
'WOW FAKE PACKAGE IS <strong>BEST</strong> <a href="http://example.org">PACKAGE</a>')); | ||
}); | ||
|
||
test('has properties', () { | ||
|
@@ -1196,7 +1197,7 @@ void main() { | |
expect( | ||
add.oneLineDoc, | ||
equals( | ||
'Adds <code>value</code> to the end of this list,\nextending the length by one. <a href="fake/SpecialList/add.html">[...]</a>')); | ||
'Adds <code>value</code> to the end of this list,\nextending the length by one.')); | ||
}); | ||
|
||
test( | ||
|
@@ -1322,8 +1323,10 @@ void main() { | |
}); | ||
|
||
test('bullet points work in top level variables', () { | ||
expect(bulletDoced.oneLineDoc, | ||
contains('<a href="fake/bulletDoced-constant.html">[...]</a>')); | ||
expect( | ||
bulletDoced.extendedDocLink, | ||
equals( | ||
ModelElementRendererHtml().renderExtendedDocLink(bulletDoced))); | ||
expect(bulletDoced.documentationAsHtml, contains('<li>')); | ||
}); | ||
}); | ||
|
@@ -2757,10 +2760,9 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans, | |
|
||
test('has extended documentation', () { | ||
expect(lengthX.hasExtendedDocumentation, isTrue); | ||
expect( | ||
lengthX.oneLineDoc, | ||
equals( | ||
'Returns a length. <a href="fake/WithGetterAndSetter/lengthX.html">[...]</a>')); | ||
expect(lengthX.oneLineDoc, equals('Returns a length.')); | ||
expect(lengthX.extendedDocLink, | ||
equals(ModelElementRendererHtml().renderExtendedDocLink(lengthX))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should have at least one literal matching string here for the Html renderer test, especially since it is very targeted -- otherwise we're simply validating that extendedDocLink returns whatever the renderer does. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
expect(lengthX.documentation, contains('the fourth dimension')); | ||
expect(lengthX.documentation, isNot(contains('[...]'))); | ||
}); | ||
|
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.
glad the no-super workaround is gone