feat(app): undo changes

Signed-off-by: Rémi Doreau <remi.d45@gmail.com>
This commit is contained in:
Rémi Doreau
2021-05-14 14:15:56 +02:00
parent a42649ce41
commit e1a5549125
14 changed files with 3 additions and 11844 deletions
+2 -3
View File
@@ -1,6 +1,5 @@
{
"baseUrl": "http://localhost:3000",
"pluginsFile": false,
"viewportHeight": 900,
"viewportWidth": 1440
"fixturesFolder": false,
"pluginsFile": false
}
+1 -10
View File
@@ -17,14 +17,5 @@
"bundledDependencies": true
}
]
},
"overrides": [
{
"files": ["*.spec.js"],
"rules": {
"jest/valid-expect": 0,
"jest/expect-expect": 0
}
}
]
}
}
File diff suppressed because one or more lines are too long
-69
View File
@@ -1,69 +0,0 @@
{
"metadata": {
"namespace": "default",
"annotations": {
"backstage.io/managed-by-location": "file:../catalog-model/examples/acme/team-a-group.yaml",
"backstage.io/managed-by-origin-location": "bootstrap:bootstrap"
},
"name": "guest",
"uid": "88074c2a-9d6b-4cd9-9d61-6901da330cac",
"etag": "YzE2NjMxN2YtOGNhNy00NWRkLTlhOTItNjFmYmIzZjM5ZDI4",
"generation": 1
},
"apiVersion": "backstage.io/v1alpha1",
"kind": "User",
"spec": {
"profile": {
"displayName": "Guest User",
"email": "guest@example.com",
"picture": "https://avatars.dicebear.com/api/avataaars/guest@example.com.svg?background=%23fff"
},
"memberOf": ["team-a"]
},
"relations": [
{
"target": { "kind": "group", "namespace": "default", "name": "team-a" },
"type": "memberOf"
},
{
"target": {
"kind": "component",
"namespace": "default",
"name": "backstage"
},
"type": "ownerOf"
},
{
"target": {
"kind": "component",
"namespace": "default",
"name": "documented-component"
},
"type": "ownerOf"
},
{
"target": {
"kind": "component",
"namespace": "default",
"name": "playback-order"
},
"type": "ownerOf"
},
{
"target": {
"kind": "component",
"namespace": "default",
"name": "searcher"
},
"type": "ownerOf"
},
{
"target": {
"kind": "component",
"namespace": "default",
"name": "shuffle-api"
},
"type": "ownerOf"
}
]
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,33 +0,0 @@
{
"metadata": {
"namespace": "default",
"annotations": {
"backstage.io/managed-by-location": "file:../../plugins/github-actions/examples/sample.yaml",
"backstage.io/managed-by-origin-location": "bootstrap:bootstrap",
"github.com/project-slug": "backstage/backstage",
"backstage.io/techdocs-ref": "url:https://github.com/backstage/backstage"
},
"name": "backstage",
"description": "backstage.io",
"uid": "b3bae9fa-c34f-47d0-ae14-547c1d77c147",
"etag": "MDU1MzdiYWYtYjFjZC00OGQ4LThhMmEtN2Q5NjA3ZGVhM2Rl",
"generation": 1
},
"apiVersion": "backstage.io/v1alpha1",
"kind": "Component",
"spec": {
"type": "website",
"lifecycle": "production",
"owner": "user:guest"
},
"relations": [
{
"target": { "kind": "user", "namespace": "default", "name": "guest" },
"type": "ownedBy"
}
],
"locationMetadata": {
"type": "url",
"target": "https://github.com/backstage/backstage"
}
}
@@ -1,4 +0,0 @@
{
"site_name": "Backstage",
"site_description": "Main documentation for Backstage features and platform APIs"
}
@@ -1 +0,0 @@
{ "message": "Docs updated or did not need updating" }
@@ -1,221 +0,0 @@
/*
* Copyright 2020 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
describe('TechDocs', () => {
beforeEach(() => {
cy.login();
});
describe('Navigating to TechDocs', () => {
beforeEach(() => {
cy.intercept('GET', '**/catalog/entities**', {
fixture: 'entities.json',
});
cy.intercept('GET', '**/guest', {
fixture: 'guest.json',
});
cy.mockTechDocs();
});
it('should navigate to the TechDocs page via the primary navigation bar', () => {
cy.visit('/');
cy.get('[data-testid="sidebar-root"]')
.get('div')
.get('a[href="/docs"]')
.click();
cy.contains('Documentation');
});
it('should navigate to the TechDocs home page from the "Overview" tab', () => {
cy.visit('/docs');
cy.get('[data-testid="read_docs"]').eq(0).click();
cy.location().should(loc => {
expect(loc.pathname).to.eq('/docs/default/Component/backstage');
});
});
it('should navigate to the TechDocs home page from the "Owned documents" tab', () => {
cy.visit('/docs');
cy.get('[data-testid="header-tab-1"]').click();
cy.get('[value="backstage"] > div > a').click();
cy.location().should(loc => {
expect(loc.pathname).to.eq('/docs/default/Component/backstage');
});
});
it('should navigate to a specific TechDocs project page', () => {
cy.visit('/docs');
cy.contains('Documentation');
});
it('should navigate to a specific TechDocs component page from a URL', () => {
cy.visit('/docs/default/Component/backstage');
cy.contains('Backstage');
cy.contains(
'Main documentation for Backstage features and platform APIs',
);
cy.getTechDocsShadowRoot().contains(
'The Backstage documentation is available at',
);
});
it('should navigate to a specific TechDocs section from a URL', () => {
cy.visit('/docs/default/Component/backstage/overview/roadmap');
cy.window().its('scrollY').should('equal', 0);
cy.getTechDocsShadowRoot().within(() => {
cy.contains('Phases');
cy.contains('Detailed roadmap');
});
});
it('should navigate to a specific TechDocs fragment from a URL', () => {
cy.visit(
'/docs/default/Component/backstage/overview/roadmap/#future-work',
);
// This is used to test the post-render behavior of the techdocs Reader
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500);
return cy.getTechDocsShadowRoot().within(() => {
cy.get('#future-work').then($el => {
cy.window()
.its('scrollY')
.should($scrollY => {
expect($scrollY).to.be.closeTo($el[0].offsetTop, 200);
});
});
});
});
it('should navigate to a wrong TechDocs component page from a URL', () => {
cy.visit('/docs/default/Component/wrong-component');
cy.get('[data-testid=error]').should('be.visible');
});
});
describe('Navigating within TechDocs', () => {
beforeEach(() => {
cy.intercept('GET', '**/catalog/entities**', {
fixture: 'entities.json',
});
cy.intercept('GET', '**/guest', {
fixture: 'guest.json',
});
cy.mockTechDocs();
});
it('should navigate to the TechDocs page via the navigation bar', () => {
cy.visit('/docs/default/Component/backstage');
cy.getTechDocsShadowRoot().within(() => {
cy.get('[data-testid="md-nav-overview"]').click();
cy.get('[data-testid="md-nav-roadmap"]').click();
cy.contains('Phases');
cy.contains('Detailed roadmap');
});
});
it('should navigate to the TechDocs page via the table of contents - Level 1', () => {
cy.visit('/docs/default/Component/backstage/overview/roadmap');
return cy.getTechDocsShadowRoot().within(() => {
cy.get('[data-testid="md-nav-phases"]').click();
cy.get('#phases').then($el => {
cy.window()
.its('scrollY')
.should($scrollY => {
expect($scrollY).to.be.closeTo($el[0].offsetTop, 200);
});
});
});
});
it('should navigate to the TechDocs page via the table of contents - Level 2', () => {
cy.visit('/docs/default/Component/backstage/overview/roadmap');
return cy.getTechDocsShadowRoot().within(() => {
cy.get('[data-testid="md-nav-future-work"]').click();
cy.get('#future-work').then($el => {
cy.window()
.its('scrollY')
.should($scrollY => {
expect($scrollY).to.be.closeTo($el[0].offsetTop, 200);
});
});
});
});
it('should navigate to a specific fragment within a TechDocs page', () => {
cy.visit('/docs/default/Component/backstage/overview/roadmap');
cy.scrollTo('bottom');
return cy.getTechDocsShadowRoot().within(() => {
cy.contains('Link to Phases').click();
cy.get('#phases').then($el => {
cy.window()
.its('scrollY')
.should($scrollY => {
expect($scrollY).to.be.closeTo($el[0].offsetTop, 200);
});
});
});
});
it('should navigate to the next page within a TechDocs page', () => {
cy.visit('/docs/default/Component/backstage/overview/roadmap');
cy.scrollTo('bottom');
cy.getTechDocsShadowRoot().within(() => {
cy.get('.md-footer-nav__link.md-footer-nav__link--next').click();
cy.location().should(loc => {
expect(loc.pathname).to.eq(
'/docs/default/Component/backstage/overview/vision/',
);
});
});
});
it('should navigate to the previous page within a TechDocs page', () => {
cy.visit('/docs/default/Component/backstage/overview/roadmap');
cy.scrollTo('bottom');
cy.getTechDocsShadowRoot().within(() => {
cy.get('.md-footer-nav__link.md-footer-nav__link--prev').click();
cy.location().should(loc => {
expect(loc.pathname).to.eq(
'/docs/default/Component/backstage/overview/architecture-overview/',
);
});
});
});
});
});
@@ -1,39 +0,0 @@
/*
* Copyright 2020 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
describe('Login', () => {
beforeEach(() => {
cy.intercept('GET', '**/catalog/entities**', {
fixture: 'entities.json',
});
cy.intercept('GET', '**/guest', {
fixture: 'guest.json',
});
});
it('should render the login page', () => {
cy.visit('/');
cy.contains('Backstage Example App');
});
it('should be able to login', () => {
cy.get('button').contains('Enter').click();
cy.url().should('include', '/catalog');
cy.contains('artist-lookup');
});
});
@@ -1,33 +0,0 @@
/*
* Copyright 2020 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
describe('Logout', () => {
before(() => {
cy.login();
});
it('should be able to logout', () => {
cy.visit('/settings');
cy.get('[data-testid="user-settings-menu"]').click();
return cy
.get('[data-testid="sign-out"]')
.click()
.then(() => {
return expect(
localStorage.getItem('@backstage/core:SignInPage:provider'),
).to.be.null;
});
});
});
-1
View File
@@ -14,4 +14,3 @@
* limitations under the License.
*/
import '@testing-library/cypress/add-commands';
import './commands';