From 98f5acebdbeff0630c34cd00003be9362b746e41 Mon Sep 17 00:00:00 2001 From: Martin Sikora Date: Sat, 9 Jun 2018 15:48:40 +0200 Subject: [PATCH] test(docs-infra): test that the "suggest edit" buttons are visible where expected (#24378) PR Close #24378 --- aio/tests/e2e/app.e2e-spec.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/aio/tests/e2e/app.e2e-spec.ts b/aio/tests/e2e/app.e2e-spec.ts index 458b102ae6..783c3f1a7a 100644 --- a/aio/tests/e2e/app.e2e-spec.ts +++ b/aio/tests/e2e/app.e2e-spec.ts @@ -179,4 +179,25 @@ describe('site App', function() { expect(results).toContain('Router'); }); }); + + describe('suggest edit link', () => { + it('should be present on all docs pages', () => { + page.navigateTo('tutorial/toh-pt1'); + expect(page.ghLinks.count()).toEqual(1); + /* tslint:disable:max-line-length */ + expect(page.ghLinks.get(0).getAttribute('href')) + .toMatch(/https:\/\/github\.com\/angular\/angular\/edit\/master\/aio\/content\/tutorial\/toh-pt1\.md\?message=docs%3A%20describe%20your%20change\.\.\./); + + page.navigateTo('guide/http'); + expect(page.ghLinks.count()).toEqual(1); + /* tslint:disable:max-line-length */ + expect(page.ghLinks.get(0).getAttribute('href')) + .toMatch(/https:\/\/github\.com\/angular\/angular\/edit\/master\/aio\/content\/guide\/http\.md\?message=docs%3A%20describe%20your%20change\.\.\./); + }); + + it('should not be present on top level pages', () => { + page.navigateTo('features'); + expect(page.ghLinks.count()).toEqual(0); + }); + }); });