-
Notifications
You must be signed in to change notification settings - Fork 353
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
Improve styling of new sidebar guides #1406
Changes from 9 commits
531c249
896990d
4a3edc7
ae25bfc
57c7808
cbc35f6
c730d6f
51da156
0facc6e
d4c120b
fb3f5c2
a94e8e3
c8d3e8d
80b2b67
61845a4
ba9a881
e477e20
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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
* Copyright (c) 2002-2021 "Neo4j," | ||
* Neo4j Sweden AB [http://neo4j.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/* global Cypress, cy, before */ | ||
|
||
describe('Play command', () => { | ||
before(function() { | ||
cy.visit(Cypress.config('url')) | ||
.title() | ||
.should('include', 'Neo4j Browser') | ||
cy.wait(3000) | ||
}) | ||
|
||
it('handles not found guides', () => { | ||
cy.executeCommand(':clear') | ||
cy.executeCommand(':guide not-found-guide-anywhere') | ||
|
||
cy.get('[data-testid="guideDrawer"]').should('contain', 'Not found') | ||
|
||
// reset state | ||
cy.executeCommand(':guide') | ||
cy.get('[data-testid="guideDrawer"]').should('contain', ':guide movie') | ||
cy.get('[data-testid=drawerGuides]').click() | ||
}) | ||
|
||
it('can walk through a guides', () => { | ||
cy.executeCommand(':clear') | ||
// Open a guide from the sidebar | ||
cy.get('[data-testid=drawerGuides]').click() | ||
cy.get('[data-testid="guideDrawer"]') | ||
.contains(':guide cypher') | ||
.click() | ||
|
||
// can progress slide | ||
cy.get('[data-testid=guideNextSlide]').click() | ||
cy.get('[data-testid="guideDrawer"]').contains('CREATE') | ||
|
||
// remembers slide location | ||
cy.get('[data-testid=drawerGuides]').click() | ||
cy.get('[data-testid=drawerGuides]').click() | ||
|
||
// can go back | ||
cy.get('[data-testid="guideDrawer"]').contains('CREATE') | ||
cy.get('[data-testid=guidePreviousSlide]').click() | ||
cy.get('[data-testid="guideDrawer"]').contains('SQL-like clauses') | ||
|
||
// go to end | ||
cy.get('[data-testid=guideNextSlide]').click() | ||
cy.get('[data-testid=guideNextSlide]').click() | ||
cy.get('[data-testid=guideNextSlide]').click() | ||
cy.get('[data-testid=guideNextSlide]').click() | ||
cy.get('[data-testid=guideNextSlide]').click() | ||
cy.get('[data-testid=guideNextSlide]').click() | ||
cy.get('[data-testid=guideNextSlide]').click() | ||
cy.get('[data-testid=guideNextSlide]').click() | ||
cy.get('[data-testid="guideDrawer"]').contains('Next steps') | ||
|
||
// switch guide via command | ||
cy.executeCommand(':guide northwind') | ||
cy.get('[data-testid="guideDrawer"]').contains('From RDBMS to Graph') | ||
|
||
// Jump to end, then new guide | ||
cy.get('[data-testid="pagination-7"]').click() | ||
cy.get('[data-testid="guideDrawer"]') | ||
.contains('Movie Graph') | ||
.click() | ||
|
||
cy.get('[data-testid="guideDrawer"]').contains('mini graph application') | ||
|
||
// Can use back button | ||
cy.get('[data-testid="guidesBackButton"]').click() | ||
cy.get('[data-testid="guideDrawer"]').contains(':guide cypher') | ||
|
||
cy.get('[data-testid=drawerGuides]').click() | ||
}) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,6 @@ | |
"e2e-local": "CYPRESS_E2E_TEST_ENV=\"local\" cypress run", | ||
"e2e-local-open": "CYPRESS_E2E_TEST_ENV=\"local\" cypress open", | ||
"format": "prettier-eslint --write 'src/**/!(*.min).{js,jsx,ts,tsx,css,json}' 'e2e_tests/**/*.{js,jsx,ts,tsx,css,json}' 'scripts/**/*.{js,jsx,ts,tsx,css,json}' 'build_scripts/**/*.{js,jsx,ts,tsx,css,json}'", | ||
"jest": "jest --coverage", | ||
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. Without this in package.json we can run |
||
"lint": "eslint --fix --ext .ts --ext .tsx ./", | ||
"precommit": "lint-staged", | ||
"prepare-jar": "node ./scripts/prepare-mvn-package.js", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,7 @@ import styled from 'styled-components' | |
export const NoBulletsUl = styled.div` | ||
list-style-type: none; | ||
` | ||
export const BulletsInsideLi = styled.li` | ||
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. unused |
||
list-style-position: inside; | ||
` | ||
|
||
export const MarginTopLi = styled.li` | ||
margin-top: 15px; | ||
` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -437,6 +437,9 @@ export const StyledSidebarSlide = styled.div.attrs({ | |
list-style-position: inside; | ||
padding-left: 0; | ||
margin-top: 0.5em; | ||
p { | ||
display: inline-block; | ||
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. Before we added list-style-position: inside; in a |
||
} | ||
} | ||
|
||
&.slide input { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright (c) "Neo4j" | ||
* Neo4j Sweden AB [http://neo4j.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { paginationHelper } from './Pagination' | ||
|
||
const D = '...' | ||
describe('Pagination', () => { | ||
test('paginationHelper', () => { | ||
// doesn't crash on out of bounds | ||
expect(paginationHelper(0, 1)).toEqual([]) | ||
|
||
// Handles simple cases | ||
expect(paginationHelper(0, 0)).toEqual([]) | ||
expect(paginationHelper(3, 0)).toEqual([0, 1, 2]) | ||
expect(paginationHelper(6, 4)).toEqual([0, 1, 2, 3, 4, 5]) | ||
|
||
// Same for list of 7 regardless of selection | ||
Array.from({ length: 7 }).forEach((_a, i) => { | ||
expect(paginationHelper(7, i)).toEqual([0, 1, 2, 3, 4, 5, 6]) | ||
}) | ||
|
||
// Handles all cases length 8 | ||
expect(paginationHelper(8, 0)).toEqual([0, 1, 2, 3, 4, D, 7]) | ||
expect(paginationHelper(8, 1)).toEqual([0, 1, 2, 3, 4, D, 7]) | ||
expect(paginationHelper(8, 2)).toEqual([0, 1, 2, 3, 4, D, 7]) | ||
expect(paginationHelper(8, 3)).toEqual([0, 1, 2, 3, 4, D, 7]) | ||
expect(paginationHelper(8, 4)).toEqual([0, D, 3, 4, 5, 6, 7]) | ||
expect(paginationHelper(8, 5)).toEqual([0, D, 3, 4, 5, 6, 7]) | ||
expect(paginationHelper(8, 6)).toEqual([0, D, 3, 4, 5, 6, 7]) | ||
expect(paginationHelper(8, 7)).toEqual([0, D, 3, 4, 5, 6, 7]) | ||
|
||
// Handles all cases length 9 | ||
expect(paginationHelper(9, 0)).toEqual([0, 1, 2, 3, 4, D, 8]) | ||
expect(paginationHelper(9, 1)).toEqual([0, 1, 2, 3, 4, D, 8]) | ||
expect(paginationHelper(9, 2)).toEqual([0, 1, 2, 3, 4, D, 8]) | ||
expect(paginationHelper(9, 3)).toEqual([0, 1, 2, 3, 4, D, 8]) | ||
expect(paginationHelper(9, 4)).toEqual([0, D, 3, 4, 5, D, 8]) | ||
expect(paginationHelper(9, 5)).toEqual([0, D, 4, 5, 6, 7, 8]) | ||
expect(paginationHelper(9, 6)).toEqual([0, D, 4, 5, 6, 7, 8]) | ||
expect(paginationHelper(9, 7)).toEqual([0, D, 4, 5, 6, 7, 8]) | ||
expect(paginationHelper(9, 8)).toEqual([0, D, 4, 5, 6, 7, 8]) | ||
}) | ||
}) |
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.
Misleading name of this test suite! ;-)