Skip to content

Commit

Permalink
Back to development
Browse files Browse the repository at this point in the history
  • Loading branch information
tisto committed Jul 26, 2020
1 parent 9a0320e commit a68a175
Show file tree
Hide file tree
Showing 5 changed files with 204 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# https://docs.npmjs.com/using-npm/developers.html#keeping-files-out-of-your-package

# Directories
api/
bin/
build/
lib/
g-api
g-api/
tests/
cypress/

# Files
.travis.yml
requirements-docs.txt
requirements-tests.txt
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log

## 7.3.1 (unreleased)

### Breaking

### Feature

### Bugfix

### Internal

## 7.3.0 (2020-07-26)

### Feature
Expand Down
78 changes: 78 additions & 0 deletions COMMITLINT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Volto Commit Messages

Volto uses the (conventional commit specification)[https://www.conventionalcommits.org/en/v1.0.0/#specification] for consistent commit messages.

All commit messages should have the following form:

````
<type>: <description>
````

## Fix

A fix (PATCH in semantic versioning) looks like this:

````
fix: correct minor typos in code
````

## Feature

A new feature (MINOR in semantic versioning) looks like this:

````
feat: add catalan language
````

## Breaking Change

Breaking changes can be indicated by either appending a "!" to the type:

````
refactor!: drop support for Node 6
````

Or adding "BREAKING CHANGE" to the commit message body text:

````
refactor!: drop support for Node 6
BREAKING CHANGE: refactor to use JavaScript features not available in Node 6.
````

## Available Types

In addition to "fix" and "feat" the following types are allowed:
build:, chore:, ci:, docs:, style:, refactor:, perf:, test:



Install commitlint:

````
npm install --save-dev @commitlint/{config-conventional,cli}
````

or via yarn:

````
yarn add @commitlint/{config-conventional,cli}
````

Create a commitlint.config.js file:

````
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
````

Add husky to package.json:

````
{
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}
````
92 changes: 92 additions & 0 deletions cypress/integration/blocks-table.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
if (Cypress.env('API') !== 'guillotina') {
describe('Table Block Tests', () => {
beforeEach(() => {
// given a logged in editor and a page in edit mode
cy.autologin();
cy.createContent('Document', 'my-page', 'My Page');
cy.visit('/my-page/edit');
cy.waitForResourceToLoad('@navigation');
cy.waitForResourceToLoad('@breadcrumbs');
cy.waitForResourceToLoad('@actions');
cy.waitForResourceToLoad('@types');
cy.waitForResourceToLoad('my-page?fullobjects');
cy.get(`.block.title [data-contents]`);
});

it('As editor I can add a Table Block', () => {
// when I add a Table Block
cy.get('.block.text [contenteditable]').click();
cy.get('button.block-add-button').click();
cy.get('.blocks-chooser .title')
.contains('Common')
.click();
cy.get('.ui.buttons .button.table').click();
cy.get('.celled.fixed.table tr th:first-child()')
.click()
.type('column 1 / row 1');
cy.get('.celled.fixed.table tr th:nth-child(2)')
.click()
.type('column 2 / row 1');
cy.get('.celled.fixed.table tr:nth-child(2) td:first-child()')
.click()
.type('column 1 / row 2');
cy.get('.celled.fixed.table tr:nth-child(2) td:nth-child(2)')
.click()
.type('column 2 / row 2');
cy.get('button[title="Insert col after"]').click();
cy.get('button[title="Insert row after"]').click();
cy.get('button[title="Insert row before"]').click();
cy.get('button[title="Insert col before"]').click();

cy.get('#toolbar-save').click();
cy.url().should('eq', Cypress.config().baseUrl + '/my-page');

// then a new Table Block has been added to the page
cy.get('.celled.fixed.table tr th:first-child()').contains(
'column 1 / row 1',
);
cy.get('.celled.fixed.table tr th:nth-child(3)').contains(
'column 2 / row 1',
);
cy.get('.celled.fixed.table tr:nth-child(3) td:first-child()').contains(
'column 1 / row 2',
);
cy.get('.celled.fixed.table tr:nth-child(3) td:nth-child(3)').contains(
'column 2 / row 2',
);

// Edit
cy.visit('/my-page/edit');
cy.get('.celled.fixed.table tr:first-child() th:nth-child(2)').click();

// without the second click the test fails. so this makes the test green.
cy.get('.celled.fixed.table tr:first-child() th:nth-child(2)').click();

cy.get('button[title="Delete col"]').click();
cy.get('.celled.fixed.table tr:first-child() th:nth-child(3)').click();
cy.get('button[title="Delete col"]').click();
cy.get('.celled.fixed.table tr:nth-child(2) td:first-child()').click();
cy.get('button[title="Delete row"]').click();
cy.get('.celled.fixed.table tr:nth-child(3) td:first-child()').click();
cy.get('button[title="Delete row"]').click();

// Save
cy.get('#toolbar-save').click();
cy.url().should('eq', Cypress.config().baseUrl + '/my-page');

//View
cy.get('.celled.fixed.table tr th:first-child()').contains(
'column 1 / row 1',
);
cy.get('.celled.fixed.table tr th:nth-child(2)').contains(
'column 2 / row 1',
);
cy.get('.celled.fixed.table tr:nth-child(2) td:first-child()').contains(
'column 1 / row 2',
);
cy.get('.celled.fixed.table tr:nth-child(2) td:nth-child(2)').contains(
'column 2 / row 2',
);
});
});
}
17 changes: 17 additions & 0 deletions docs/source/performance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Volto Performance

Performance analysis is a complex topic. This document offers a starting point to analyzing an optimizing the performance of Volto.

## Tools

### Dev Toolbar

All modern browsers off

### WebPageTest

### Lighthouse

### Page Speed Insights

### jMeter

0 comments on commit a68a175

Please sign in to comment.