Skip to content

Commit

Permalink
Use latest volto-industry-theme
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Nov 1, 2021
1 parent da3cf12 commit 86210ba
Show file tree
Hide file tree
Showing 17 changed files with 717 additions and 2,117 deletions.
2 changes: 1 addition & 1 deletion cypress/fixtures/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
}
22 changes: 0 additions & 22 deletions cypress/helpers/actions/index.js

This file was deleted.

48 changes: 0 additions & 48 deletions cypress/helpers/blocks/index.js

This file was deleted.

24 changes: 0 additions & 24 deletions cypress/helpers/data.js

This file was deleted.

4 changes: 0 additions & 4 deletions cypress/helpers/index.js

This file was deleted.

36 changes: 0 additions & 36 deletions cypress/helpers/sidebar/index.js

This file was deleted.

57 changes: 0 additions & 57 deletions cypress/helpers/utils.js

This file was deleted.

32 changes: 32 additions & 0 deletions cypress/integration/block-basics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { setupBeforeEach, tearDownAfterEach } from '../support';

describe('Blocks Tests', () => {
beforeEach(setupBeforeEach);
afterEach(tearDownAfterEach);

it('Add Block: Empty', () => {
// Change page title
cy.get('.documentFirstHeading > .public-DraftStyleDefault-block')
.clear()
.type('My Add-on Page')
.get('.documentFirstHeading span[data-text]')
.contains('My Add-on Page');

cy.get('.documentFirstHeading > .public-DraftStyleDefault-block').type(
'{enter}',
);

// Add block
cy.get('.ui.basic.icon.button.block-add-button').first().click();
cy.get('.blocks-chooser .title').contains('Media').click();
cy.get('.content.active.media .button.image').contains('Image').click();

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

// then the page view should contain our changes
cy.contains('My Add-on Page');
cy.get('.block.image');
});
});
50 changes: 0 additions & 50 deletions cypress/integration/sites.js

This file was deleted.

5 changes: 5 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
/* coverage-start
require('@cypress/code-coverage/task')(on, config)
on('file:preprocessor', require('@cypress/code-coverage/use-babelrc'))
return config
coverage-end */
};
34 changes: 0 additions & 34 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,20 +302,6 @@ function setBaseAndExtent(...args) {
document.getSelection().setBaseAndExtent(...args);
}

function getIfExists(
selector,
successAction = () => {},
failAction = () => {},
) {
cy.get('body').then((body) => {
if (body.find(selector).length > 0 && successAction) {
successAction();
} else if (failAction) {
failAction();
}
});
}

Cypress.Commands.add('navigate', (route = '') => {
return cy.window().its('appHistory').invoke('push', route);
});
Expand All @@ -327,23 +313,3 @@ Cypress.Commands.add('store', () => {
Cypress.Commands.add('settings', (key, value) => {
return cy.window().its('settings');
});

Cypress.Commands.add('getIfExists', getIfExists);

Cypress.Commands.add(
'controlledTextAreaChange',
{ prevSubject: 'element' },
(input, value) => {
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(
window.HTMLTextAreaElement.prototype,
'value',
).set;
const changeInputValue = (inputToChange) => (newValue) => {
nativeInputValueSetter.call(inputToChange[0], newValue);
inputToChange[0].dispatchEvent(
new Event('change', { newValue, bubbles: true }),
);
};
return cy.get(input).then((input) => changeInputValue(input)(value));
},
);
5 changes: 5 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ import './commands';
// Alternatively you can use CommonJS syntax:
// require('./commands')

/* coverage-start
//Generate code-coverage
import '@cypress/code-coverage/support';
coverage-end */

export const setupBeforeEach = () => {
cy.autologin();
cy.createContent({
Expand Down
Binary file removed cypress/videos/sites.js.mp4
Binary file not shown.
14 changes: 9 additions & 5 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"compilerOptions": {
"paths": {},
"baseUrl": "src"
}
}
"compilerOptions": {
"paths": {
"@eeacms/volto-industry-theme": [
"addons/volto-industry-theme/src"
]
},
"baseUrl": "src"
}
}
10 changes: 9 additions & 1 deletion mrs.developer.json
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
{}
{
"volto-industry-theme": {
"url": "git@github.com:eea/volto-industry-theme.git",
"https": "https://github.com/eea/volto-industry-theme.git",
"package": "@eeacms/volto-industry-theme",
"branch": "develop",
"path": "src"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
},
"dependencies": {
"@plone/volto": "13.15.1",
"@eeacms/volto-industry-theme": "eea/volto-industry-theme#develop",
"@eeacms/volto-industry-theme": "0.1.1",
"@eeacms/volto-columns-block": "4.4.6",
"@eeacms/volto-eea-kitkat": "4.0.2"
"@eeacms/volto-eea-kitkat": "4.1.1"
},
"devDependencies": {
"eslint-plugin-prettier": "3.1.3",
Expand Down
Loading

0 comments on commit 86210ba

Please sign in to comment.