Skip to content

Commit 7e6b091

Browse files
committed
test(web-react): use localName instead of tagName in element assertions
1 parent 9a99a4d commit 7e6b091

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/web-react/src/components/Stack/__tests__/Stack.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ describe('Stack', () => {
9494

9595
const list = screen.getByRole('list');
9696

97-
expect(list.tagName).toBe('UL');
97+
expect(list.localName).toBe('ul');
9898

9999
const item = screen.getByTestId('item');
100100

101101
expect(item).toBeInTheDocument();
102-
expect(item.tagName).toBe('LI');
102+
expect(item.localName).toBe('li');
103103
expect(item).toHaveTextContent('Item');
104104
});
105105

@@ -112,12 +112,12 @@ describe('Stack', () => {
112112

113113
const list = screen.getByRole('list');
114114

115-
expect(list.tagName).toBe('OL');
115+
expect(list.localName).toBe('ol');
116116

117117
const item = screen.getByTestId('item');
118118

119119
expect(item).toBeInTheDocument();
120-
expect(item.tagName).toBe('LI');
120+
expect(item.localName).toBe('li');
121121
expect(item).toHaveTextContent('Item');
122122
});
123123

packages/web-react/src/components/Stack/__tests__/StackItem.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ describe('StackItem', () => {
3636
const item = screen.getByTestId('standalone');
3737

3838
expect(item).toBeInTheDocument();
39-
expect(item.tagName).toBe('DIV');
39+
expect(item.localName).toBe('div');
4040
});
4141
});

packages/web-react/src/components/UNSTABLE_Attachment/__tests__/UNSTABLE_AttachmentImagePreview.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ describe('UNSTABLE_AttachmentImagePreview', () => {
5858
const root = screen.getByTestId('preview-root');
5959

6060
expect(root).toHaveClass('Attachment__image');
61-
expect(root.tagName).toBe('SPAN');
61+
expect(root.localName).toBe('span');
6262
});
6363
});

0 commit comments

Comments
 (0)