Skip to content

Commit

Permalink
refctor review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkithelegendarypokemonster committed Sep 24, 2024
1 parent 884292c commit 5928c7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
9 changes: 2 additions & 7 deletions e2e/testcafe-devextreme/tests/accessibility/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,20 @@ const items: Item[] = [
const options: Options<Properties> = {
items: [items],
disabled: [true, false],
width: [400, 1024],
orientation: ['horizontal', 'vertical'],
adaptivityEnabled: [true, false],
};

const created = async (t: TestController, optionConfiguration): Promise<void> => {
const { disabled, adaptivityEnabled } = optionConfiguration;
const { disabled } = optionConfiguration;

if (disabled) {
return;
}

const menu = new Menu();

if (adaptivityEnabled) {
await menu.option('width', 400);
} else {
await menu.option('width', 1024);
}

await t
.click(menu.getItem(0))
.pressKey('down')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2970,20 +2970,17 @@ QUnit.module('adaptivity: render', {
fx.off = false;
}
}, () => {
QUnit.test('Adds "menu bar" role when menu is wider than item', function(assert) {
$('#qunit-fixture').width(100);
QUnit.test('Adds "menubar" role when menu is wider than item', function(assert) {
new Menu(this.$element, {
items: this.items,
adaptivityEnabled: true,
width: 1000
});


assert.strictEqual(this.$element.attr('role'), 'menubar');
});

QUnit.test('No role added when menu is smaller than item', function(assert) {
$('#qunit-fixture').width(100);
new Menu(this.$element, {
items: this.items,
adaptivityEnabled: true,
Expand All @@ -2994,7 +2991,6 @@ QUnit.module('adaptivity: render', {
});

QUnit.test('Adds "menu bar" role when menu width is increased at runtime', function(assert) {
$('#qunit-fixture').width(100);
const instance = new Menu(this.$element, {
items: this.items,
adaptivityEnabled: true,
Expand All @@ -3009,7 +3005,6 @@ QUnit.module('adaptivity: render', {
});

QUnit.test('Removes role when menu width is decreased at runtime', function(assert) {
$('#qunit-fixture').width(100);
const instance = new Menu(this.$element, {
items: this.items,
adaptivityEnabled: true,
Expand Down

0 comments on commit 5928c7e

Please sign in to comment.