Skip to content

Commit 8787213

Browse files
committed
temp
1 parent 3561529 commit 8787213

3 files changed

Lines changed: 35 additions & 21 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
- charts
2020
- cypress-commands
2121
- main/src/components
22+
- main/src/components/SelectDialog
2223
- main/src/webComponents
2324
- main/src/internal
2425
- compat

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
"scripts": {
99
"start": "yarn setup && yarn create-cypress-commands-docs && npm-run-all -p start:watcher start:storybook",
1010
"start:watcher": "lerna run watch:css",
11-
"start:storybook": "storybook dev -p 6006",
11+
"start:storybook": "storybook dev -p 6008",
1212
"setup": "lerna run build:i18n && lerna run build:css && lerna run build:css-bundle && lerna run build:version-info && rimraf node_modules/@types/mocha",
1313
"build": "yarn setup && tsc --build tsconfig.build.json && lerna run build:client && lerna run build:wrapper",
1414
"build:storybook": "yarn build && yarn create-cypress-commands-docs && storybook build -o .out",
1515
"build:storybook-sitemap": "node ./scripts/create-storybook-sitemap.js --directory .out",
1616
"test:prepare": "rimraf temp && lerna run build",
1717
"test:open": "CYPRESS_COVERAGE=false cypress open --component --browser chrome",
18-
"test": "yarn test:prepare && cypress run --component --browser chrome --spec packages",
18+
"test": "yarn test:prepare && cypress run --component --browser chrome --spec packages/main/src/components/SelectDialog",
1919
"clean": "tsc --build --clean && tsc --build tsconfig.build.json --clean && rimraf temp .out && lerna run clean",
2020
"clean:remove-modules": "yarn clean && rimraf node_modules",
2121
"prettier:all": "prettier --write --config ./prettier.config.js \"**/*\"",

packages/main/src/components/SelectDialog/SelectDialog.cy.tsx

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -304,23 +304,36 @@ describe('SelectDialog', () => {
304304
cy.findByTestId('confirmBtn').should('have.attr', 'design', 'Emphasized');
305305
});
306306

307-
it('invisible messaging', () => {
308-
cy.mount(
309-
<SelectDialog open selectionMode={ListSelectionMode.Multiple}>
310-
<ListItemStandard text={'ListItem 1'} data-testid="1" />
311-
<ListItemStandard text={'ListItem 2'} data-testid="2" />
312-
<ListItemStandard text={'ListItem 3'} data-testid="3" />
313-
<ListItemStandard text={'ListItem 4'} data-testid="4" />
314-
</SelectDialog>,
315-
);
316-
cy.findByTestId('1').click();
317-
cy.get('ui5-announcement-area').should('contain.text', 'Selected Items 1');
318-
cy.findByTestId('1').click();
319-
cy.get('ui5-announcement-area').should('not.contain.text', 'Selected Items 1');
320-
cy.findByTestId('1').click();
321-
cy.findByTestId('2').click();
322-
cy.findByTestId('3').click();
323-
cy.findByTestId('4').click();
324-
cy.get('ui5-announcement-area').should('contain.text', 'Selected Items 4');
325-
});
307+
for (let i = 0; i <= 100; ++i) {
308+
it.only('invisible messaging', () => {
309+
cy.mount(
310+
<SelectDialog open selectionMode={ListSelectionMode.Multiple}>
311+
<ListItemStandard text={'ListItem 1'} data-testid="1" />
312+
<ListItemStandard text={'ListItem 2'} data-testid="2" />
313+
<ListItemStandard text={'ListItem 3'} data-testid="3" />
314+
<ListItemStandard text={'ListItem 4'} data-testid="4" />
315+
</SelectDialog>,
316+
);
317+
// Note: announce() from @ui5/webcomponents-base sets textContent="" before setting the message,
318+
// creating a brief moment where the text is empty. cy.wait(0) yields to the event loop to let the DOM settle.
319+
cy.findByTestId('1').click();
320+
cy.findByTestId('1').should('have.attr', 'selected');
321+
cy.wait(0);
322+
cy.get('ui5-announcement-area').should('contain.text', 'Selected Items 1');
323+
cy.findByTestId('1').click();
324+
cy.findByTestId('1').should('not.have.attr', 'selected');
325+
cy.wait(0);
326+
cy.get('ui5-announcement-area').should('not.contain.text', 'Selected Items 1');
327+
cy.findByTestId('1').click();
328+
cy.findByTestId('1').should('have.attr', 'selected');
329+
cy.findByTestId('2').click();
330+
cy.findByTestId('2').should('have.attr', 'selected');
331+
cy.findByTestId('3').click();
332+
cy.findByTestId('3').should('have.attr', 'selected');
333+
cy.findByTestId('4').click();
334+
cy.findByTestId('4').should('have.attr', 'selected');
335+
cy.wait(0);
336+
cy.get('ui5-announcement-area').should('contain.text', 'Selected Items 4');
337+
});
338+
}
326339
});

0 commit comments

Comments
 (0)