Skip to content
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
"@babel/register": "^7.28.3",
"@emotion/core": "^11.0.0",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^14.2.2",
"@testing-library/react": "^15.0.5",
"@testing-library/user-event": "^14.6.1",
"autoprefixer": "^10.4.22",
"babel-gettext-extractor": "https://github.com/willdurand/babel-gettext-extractor#5.1.0",
Expand Down
15 changes: 9 additions & 6 deletions tests/unit/amo/components/TestAddonsCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ describe(__filename, () => {
expect(screen.getAllByRole('alert')).toHaveLength(
DEFAULT_API_PAGE_SIZE * 4,
);
// By default we do not want "theme" placeholders.
const imgs = screen.getAllByRole('img');
// We can't use `getAllByRole('img')` because the `img` doesnt' have an
// `alt` text in `SearchResult` when rendered as a placeholder.
const imgs = screen.getAllByClassName('SearchResult-icon--loading');
expect(imgs).toHaveLength(DEFAULT_API_PAGE_SIZE);
expect(imgs[0]).toHaveClass('SearchResult-icon--loading');
});

it('handles an empty set of addons', () => {
Expand All @@ -162,15 +162,18 @@ describe(__filename, () => {
expect(screen.queryByRole('img')).not.toBeInTheDocument();
});

it('allows you configure the number of placeholders', () => {
it('allows you to configure the number of placeholders', () => {
const placeholderCount = 2;
render({
addons: null,
loading: true,
placeholderCount,
});

expect(screen.getAllByRole('img')).toHaveLength(placeholderCount);
// We can't use `getAllByRole('img')` because the `img` doesnt' have an
// `alt` text in `SearchResult` when rendered as a placeholder.
expect(screen.getAllByClassName('SearchResult-result')).toHaveLength(
placeholderCount,
);
});

it('renders addons even when loading', () => {
Expand Down
28 changes: 14 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1902,18 +1902,18 @@
resolved "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz#5981a8db18b56ba38ef0efb7d995b12aa7b51918"
integrity sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==

"@testing-library/dom@^9.0.0":
version "9.2.0"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-9.2.0.tgz#0e1f45e956f2a16f471559c06edd8827c4832f04"
integrity sha512-xTEnpUKiV/bMyEsE5bT4oYA0x0Z/colMtxzUY8bKyPXBNLn/e0V4ZjBZkEhms0xE4pv9QsPfSRu9AWS4y5wGvA==
"@testing-library/dom@^10.0.0":
version "10.4.1"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-10.4.1.tgz#d444f8a889e9a46e9a3b4f3b88e0fcb3efb6cf95"
integrity sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==
dependencies:
"@babel/code-frame" "^7.10.4"
"@babel/runtime" "^7.12.5"
"@types/aria-query" "^5.0.1"
aria-query "^5.0.0"
chalk "^4.1.0"
aria-query "5.3.0"
dom-accessibility-api "^0.5.9"
lz-string "^1.5.0"
picocolors "1.1.1"
pretty-format "^27.0.2"

"@testing-library/jest-dom@^6.9.1":
Expand All @@ -1928,13 +1928,13 @@
picocolors "^1.1.1"
redent "^3.0.0"

"@testing-library/react@^14.2.2":
version "14.2.2"
resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-14.2.2.tgz#74f855215c57d423282486a395a4348a837d3c5a"
integrity sha512-SOUuM2ysCvjUWBXTNfQ/ztmnKDmqaiPV3SvoIuyxMUca45rbSWWAT/qB8CUs/JQ/ux/8JFs9DNdFQ3f6jH3crA==
"@testing-library/react@^15.0.5":
version "15.0.5"
resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-15.0.5.tgz#71bcc875e1142c3924cac7bdd7dc9a6db0bb1d42"
integrity sha512-ttodVWYA2i2w4hRa6krKrmS1vKxAEkwDz34y+CwbcrbZUxFzUYN3a5xZyFKo+K6LBseCRCUkwcjATpaNn/UsIA==
dependencies:
"@babel/runtime" "^7.12.5"
"@testing-library/dom" "^9.0.0"
"@testing-library/dom" "^10.0.0"
"@types/react-dom" "^18.0.0"

"@testing-library/user-event@^14.6.1":
Expand Down Expand Up @@ -2712,7 +2712,7 @@ argparse@^2.0.1:
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==

aria-query@^5.0.0:
aria-query@5.3.0, aria-query@^5.0.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.0.tgz#650c569e41ad90b51b3d7df5e5eed1c7549c103e"
integrity sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==
Expand Down Expand Up @@ -3359,7 +3359,7 @@ center-align@^0.1.1:
align-text "^0.1.3"
lazy-cache "^1.0.3"

chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2:
chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
Expand Down Expand Up @@ -8618,7 +8618,7 @@ photoswipe@5.4.4:
resolved "https://registry.yarnpkg.com/photoswipe/-/photoswipe-5.4.4.tgz#e045dc036453493188d5c8665b0e8f1000ac4d6e"
integrity sha512-WNFHoKrkZNnvFFhbHL93WDkW3ifwVOXSW3w1UuZZelSmgXpIGiZSNlZJq37rR8YejqME2rHs9EhH9ZvlvFH2NA==

picocolors@^1.0.0, picocolors@^1.1.1:
picocolors@1.1.1, picocolors@^1.0.0, picocolors@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b"
integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==
Expand Down