Skip to content

Commit

Permalink
BACKLOG-23137 Add static choicelist test (#1757)
Browse files Browse the repository at this point in the history
* BACKLOG-23137 Add static test

* BACKLOG-23137 Enable module on site
  • Loading branch information
AKarmanov authored Sep 24, 2024
1 parent 39d8b5e commit 977ddd1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/cypress/e2e/choicelist.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import {JContent} from '../page-object';
import {createSite, deleteSite, Dropdown, enableModule, getComponentBySelector} from '@jahia/cypress';

// Override defined in jcontent-test-module, forms/cent_choiceListSelectorTypeOverride.json
describe('Choicelist tests', {defaultCommandTimeout: 10000}, () => {
let jcontent: JContent;

const siteKey = 'contentEditorSite';

before(() => {
createSite(siteKey);
enableModule('content-editor-test-module', siteKey);
});

beforeEach(() => {
cy.loginEditor();
});

after(() => {
deleteSite(siteKey);
cy.logout();
});

it('should select from basic static choicelist with no default value', () => {
jcontent = JContent.visit(siteKey, 'en', 'content-folders/contents');
jcontent.createContent('choiceListSelectorTypeOverride');
const field: Dropdown = getComponentBySelector(Dropdown, '[data-sel-content-editor-field="cent:choiceListSelectorTypeOverride_noDefaultList"]');
field.select('choice1');
field.get().click();
field.get().find('.moonstone-menuItem').should('have.length', 2);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
[cent:testOverride] > jnt:content, mix:title, jmix:basicContent, jmix:editorialContent
- jcr:title (string) < '^.{0,10}$'

[cent:choiceListSelectorTypeOverride] > jnt:content, mix:title, jmix:basicContent, jmix:editorialContent
- noDefaultList (string, choicelist) < 'choice1', 'choice2'

[cent:testRegExp] > jnt:content, jmix:basicContent
- badge (string) mandatory < '[a-z0-9]+'
- comment (string) mandatory < '^.{1,15}$'
Expand Down

0 comments on commit 977ddd1

Please sign in to comment.