Skip to content

Commit 9052e47

Browse files
committed
add checks for data-pressed
1 parent f0d9772 commit 9052e47

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

packages/react-aria-components/test/ComboBox.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ describe('ComboBox', () => {
111111
let button = getByRole('button');
112112

113113
expect(button).not.toHaveAttribute('data-expanded');
114+
expect(button).not.toHaveAttribute('data-pressed');
114115
await user.click(button);
115116
expect(button).toHaveAttribute('data-expanded');
117+
expect(button).not.toHaveAttribute('data-pressed');
116118
});
117119

118120
it('should set data-expanded on button when popover is open', async () => {

packages/react-aria-components/test/DatePicker.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,10 @@ describe('DatePicker', () => {
109109
let button = getByRole('button');
110110

111111
expect(button).not.toHaveAttribute('data-expanded');
112+
expect(button).not.toHaveAttribute('data-pressed');
112113
await user.click(button);
113114
expect(button).toHaveAttribute('data-expanded');
115+
expect(button).not.toHaveAttribute('data-pressed');
114116
});
115117

116118
it('should set data-expanded on button when popover is open', async () => {

packages/react-aria-components/test/DateRangePicker.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,10 @@ describe('DateRangePicker', () => {
131131
let button = getByRole('button');
132132

133133
expect(button).not.toHaveAttribute('data-expanded');
134+
expect(button).not.toHaveAttribute('data-pressed');
134135
await user.click(button);
135136
expect(button).toHaveAttribute('data-expanded');
137+
expect(button).not.toHaveAttribute('data-pressed');
136138
});
137139

138140
it('should set data-expanded on button when popover is open', async () => {

packages/react-aria-components/test/Dialog.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ describe('Dialog', () => {
6868

6969
let button = getByRole('button');
7070
expect(button).not.toHaveAttribute('data-expanded');
71+
expect(button).not.toHaveAttribute('data-pressed');
7172

7273
await user.click(button);
7374
expect(button).toHaveAttribute('data-expanded', 'true');
75+
expect(button).not.toHaveAttribute('data-pressed');
7476
});
7577

7678
it('works with modal', async () => {

packages/react-aria-components/test/Menu.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,11 @@ describe('Menu', () => {
521521

522522
let button = getByRole('button');
523523
expect(button).not.toHaveAttribute('data-expanded');
524+
expect(button).not.toHaveAttribute('data-pressed');
524525

525526
await user.click(button);
526527
expect(button).toHaveAttribute('data-expanded');
528+
expect(button).not.toHaveAttribute('data-pressed');
527529

528530
let menu = getByRole('menu');
529531
expect(getAllByRole('menuitem')).toHaveLength(5);

packages/react-aria-components/test/Select.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ describe('Select', () => {
5050
let trigger = selectTester.trigger;
5151
expect(trigger).toHaveTextContent('Select an item');
5252
expect(trigger).not.toHaveAttribute('data-expanded');
53+
expect(trigger).not.toHaveAttribute('data-pressed');
5354

5455
expect(wrapper).toHaveAttribute('data-foo', 'bar');
5556

@@ -68,6 +69,7 @@ describe('Select', () => {
6869
await selectTester.open();
6970

7071
expect(trigger).toHaveAttribute('data-expanded', 'true');
72+
expect(trigger).not.toHaveAttribute('data-pressed');
7173
let listbox = selectTester.listbox;
7274
expect(listbox).toHaveAttribute('class', 'react-aria-ListBox');
7375
expect(listbox.closest('.react-aria-Popover')).toBeInTheDocument();

0 commit comments

Comments
 (0)