Skip to content

test(spindle-ui): check aria attributes in Breadcrumb#771

Open
herablog wants to merge 2 commits into
mainfrom
test/Breadcrumb
Open

test(spindle-ui): check aria attributes in Breadcrumb#771
herablog wants to merge 2 commits into
mainfrom
test/Breadcrumb

Conversation

@herablog

@herablog herablog commented Aug 9, 2023

Copy link
Copy Markdown
Member

BreadcrumbのDesign Docを見ていく中で、aria-*の確認できていないなあだったのでテストを追加しました。

パンくずリストのnav要素に aria-label="パンくずリスト"、現在位置には aria-current="page" を付与している

@herablog herablog requested a review from tokimari August 9, 2023 09:25
@herablog herablog self-assigned this Aug 9, 2023
@reg-suit

reg-suit Bot commented Aug 9, 2023

Copy link
Copy Markdown

✨✨ That's perfect, there is no visual difference! ✨✨

Check out the report here.

@github-actions

github-actions Bot commented Aug 9, 2023

Copy link
Copy Markdown
Contributor

Visit the preview URL for this PR (updated for commit dfc2d90):

https://ameba-spindle--pr771-test-breadcrumb-82ienvbh.web.app

(expires Fri, 08 Sep 2023 09:33:08 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: e7521619a2dd5c653490c8246e81ec2a5c8f1435

@tokimari tokimari left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

テスト対象が明確になってよいですね 😄 🎉

expect(screen.getByRole('navigation').getAttribute('aria-label')).toEqual(
'パンくずリスト',
);
expect(screen.getByText('Amebaとは').getAttribute('aria-current')).toEqual(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nits. Top, Teamのリンクには aria-current が無いこともテストしておきますか??

@@ -0,0 +1,25 @@
import React from 'react';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

q.

"src/**/*.test.*",
でtestファイルを除外しているのでエラー表示されてしまうのですが、testファイルも対象に含めておきますか??

image

(Button.test.tsxも同様でした)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants