diff --git a/test/end2end/dartdoc_test.dart b/test/end2end/dartdoc_test.dart index 7256c831d8..03273a66a9 100644 --- a/test/end2end/dartdoc_test.dart +++ b/test/end2end/dartdoc_test.dart @@ -148,21 +148,6 @@ void main() { hasLength(kTestPackagePublicLibraries + 2)); expect(packageGraph.localPackages.length, equals(1)); }); - - test('source code links are visible', () async { - // Picked this object as this library explicitly should never contain - // a library directive, so we can predict what line number it will be. - var anonymousOutput = _resourceProvider.getFile(_pathContext.join( - tempDir.path, - 'anonymous_library', - 'anonymous_library-library.html')); - expect(anonymousOutput.exists, isTrue); - expect( - anonymousOutput.readAsStringSync(), - contains(r'' - 'description')); - }); }); test('generate docs for ${p.basename(_testPackageBadDir.path)} fails', diff --git a/test/templates/extension_test.dart b/test/templates/extension_test.dart index 868aa0124b..44a53147f2 100644 --- a/test/templates/extension_test.dart +++ b/test/templates/extension_test.dart @@ -97,6 +97,12 @@ extension E on C { } '''), ], + dartdocOptions: ''' +dartdoc: + linkToSource: + root: '.' + uriTemplate: 'https://github.com/dart-lang/TEST_PKG/%f%#L%l%' +''', resourceProvider: resourceProvider, ); await writeDartdocResources(resourceProvider); @@ -200,14 +206,15 @@ extension E on C { test('enum sidebar contains static properties', () async { expect( - eLines, - containsAllInOrder([ - matches('
Static properties'), - matches('gs1'), - matches('sf1'), - ])); + eLines, + containsAllInOrder([ + matches('
Static properties'), + matches('gs1'), + matches('sf1'), + ]), + ); }); test('enum sidebar contains static methods', () async { @@ -220,5 +227,16 @@ extension E on C { matches('s1'), ])); }); + + test('extension page contains source link', () async { + expect( + eLines, + containsAllInOrder([ + matches('' + 'description'), + ]), + ); + }); }); }