Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps(ui): Upgrade react testing library dependencies #72137

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,10 @@
"@sentry/jest-environment": "6.0.0",
"@sentry/profiling-node": "^8.0.0",
"@styled/typescript-styled-plugin": "^1.0.1",
"@testing-library/dom": "10.1.0",
"@testing-library/jest-dom": "6.4.5",
"@testing-library/react": "^14.2.1",
"@testing-library/user-event": "^14.5.2",
"@testing-library/react": "16.0.0",
"@testing-library/user-event": "14.5.2",
"@types/node": "^20.11.7",
"babel-gettext-extractor": "^4.1.3",
"babel-jest": "29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/sidebar/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ describe('Sidebar', function () {
const {unmount} = renderSidebar({organization});

// This will start timer to mark as seen
await userEvent.click(await screen.findByRole('link', {name: "What's new"}), {
await userEvent.click(await screen.findByTestId('sidebar-broadcasts'), {
evanpurkhiser marked this conversation as resolved.
Show resolved Hide resolved
delay: null,
});
expect(await screen.findByText("What's new in Sentry")).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ describe('SwitchOrganization', function () {
expect(screen.getByRole('list')).toBeInTheDocument();

expect(screen.getByText('Organization 1')).toBeInTheDocument();
expect(screen.getByRole('link', {name: 'org slug Organization 1'})).toHaveAttribute(
expect(screen.getByRole('link', {name: 'OS Organization 1'})).toHaveAttribute(
'href',
'/organizations/org-slug/issues/'
);

expect(screen.getByText('Organization 2')).toBeInTheDocument();
expect(screen.getByRole('link', {name: 'org2 Organization 2'})).toHaveAttribute(
expect(screen.getByRole('link', {name: 'O Organization 2'})).toHaveAttribute(
'href',
'/organizations/org2/issues/'
);
Expand Down Expand Up @@ -57,11 +57,11 @@ describe('SwitchOrganization', function () {

expect(screen.getByRole('list')).toBeInTheDocument();

const org1Link = screen.getByRole('link', {name: 'org1 Organization 1'});
const org1Link = screen.getByRole('link', {name: 'O Organization 1'});
expect(org1Link).toBeInTheDocument();
expect(org1Link).toHaveAttribute('href', '/organizations/org1/issues/');

const org2Link = screen.getByRole('link', {name: 'org2 Organization 2'});
const org2Link = screen.getByRole('link', {name: 'O Organization 2'});
expect(org2Link).toBeInTheDocument();
expect(org2Link).toHaveAttribute(
'href',
Expand Down Expand Up @@ -92,11 +92,11 @@ describe('SwitchOrganization', function () {

expect(screen.getByRole('list')).toBeInTheDocument();

const org1Link = screen.getByRole('link', {name: 'org1 Organization 1'});
const org1Link = screen.getByRole('link', {name: 'O Organization 1'});
Copy link
Member Author

@scttcper scttcper Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it was able to get the aria label on the svg before.
now it is the literal text of the avatar

the link content looks like this
<avatar aria-label="org1">O</avatar> Organization 1

expect(org1Link).toBeInTheDocument();
expect(org1Link).toHaveAttribute('href', '/organizations/org1/issues/');

const org2Link = screen.getByRole('link', {name: 'org2 Organization 2'});
const org2Link = screen.getByRole('link', {name: 'O Organization 2'});
expect(org2Link).toBeInTheDocument();
expect(org2Link).toHaveAttribute('href', '/organizations/org2/issues/');
jest.useRealTimers();
Expand Down Expand Up @@ -128,7 +128,7 @@ describe('SwitchOrganization', function () {

expect(screen.getByRole('list')).toBeInTheDocument();

const org1Link = screen.getByRole('link', {name: 'org1 Organization 1'});
const org1Link = screen.getByRole('link', {name: 'O Organization 1'});
expect(org1Link).toBeInTheDocument();
// Current hostname in the URL is expected to be org2.sentry.io, so we need to make use of sentryUrl to link to an
// organization that does not support customer domains.
Expand All @@ -137,7 +137,7 @@ describe('SwitchOrganization', function () {
'https://sentry.io/organizations/org1/issues/'
);

const org2Link = screen.getByRole('link', {name: 'org2 Organization 2'});
const org2Link = screen.getByRole('link', {name: 'O Organization 2'});
expect(org2Link).toBeInTheDocument();
expect(org2Link).toHaveAttribute(
'href',
Expand Down Expand Up @@ -180,11 +180,11 @@ describe('SwitchOrganization', function () {

expect(screen.getByRole('list')).toBeInTheDocument();

const org1Link = screen.getByRole('link', {name: 'org1 Organization 1'});
const org1Link = screen.getByRole('link', {name: 'O Organization 1'});
expect(org1Link).toBeInTheDocument();
expect(org1Link).toHaveAttribute('href', '/organizations/org1/issues/');

const org3Link = screen.getByRole('link', {name: 'org3 Organization 3'});
const org3Link = screen.getByRole('link', {name: 'O Organization 3'});
expect(org3Link).toBeInTheDocument();
expect(org3Link).toHaveAttribute(
'href',
Expand Down
Loading
Loading