Skip to content

Commit

Permalink
updates the previous and next aria labels
Browse files Browse the repository at this point in the history
  • Loading branch information
StoneBenHMCTS committed Feb 10, 2025
1 parent cefb4e9 commit 979a1c5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
"version": "7.1.36-pagination-descriptor-v4",
"version": "7.1.36-pagination-descriptor-v5",
"engines": {
"node": ">=18.19.0"
},
Expand Down
2 changes: 1 addition & 1 deletion projects/ccd-case-ui-toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
"version": "7.1.36-pagination-descriptor-v4",
"version": "7.1.36-pagination-descriptor-v5",
"engines": {
"node": ">=18.19.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
[class.responsive]="responsive" *ngIf="!(autoHide && p.pages.length <= 1)">
<li class="pagination-previous" [class.disabled]="p.isFirstPage()" *ngIf="directionLinks">
<a tabindex="0" *ngIf="1 < p.getCurrent()" (keyup.enter)="p.previous()" (click)="p.previous()"
[attr.aria-label]="previousLabel + ' ' + screenReaderPageLabel | rpxTranslate">
[attr.aria-label]="previousLabel + ' page' | rpxTranslate">
{{ previousLabel | rpxTranslate }} <span class="show-for-sr">{{ screenReaderPageLabel | rpxTranslate }}</span>
</a>
<span *ngIf="p.isFirstPage()" [attr.aria-label]="previousLabel + ' ' + screenReaderPageLabel | rpxTranslate">
<span *ngIf="p.isFirstPage()" [attr.aria-label]="previousLabel + ' page' | rpxTranslate">
{{ previousLabel | rpxTranslate }} <span class="show-for-sr">{{ screenReaderPageLabel | rpxTranslate }}</span>
</span>
</li>
Expand All @@ -29,7 +29,7 @@
</li>
<li class="pagination-next" [class.disabled]="p.isLastPage()" *ngIf="directionLinks">
<a tabindex="0" *ngIf="!p.isLastPage()" (keyup.enter)="p.next()" (click)="p.next()"
[attr.aria-label]="nextLabel + ' ' + screenReaderPageLabel | rpxTranslate">
[attr.aria-label]="nextLabel + ' page' | rpxTranslate">
{{ nextLabel | rpxTranslate }} <span class="show-for-sr">{{ screenReaderPageLabel | rpxTranslate }}</span>
</a>
<span *ngIf="p.isLastPage()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,11 @@ describe('PaginationComponent:', () => {

const prevA = fixture.debugElement.query(By.css('.pagination-previous > a')).nativeElement;
expect(prevA.innerText.replace(/\n/, ' ')).toContain(`Previous ${TEST_LABEL}`);
expect(prevA.getAttribute('aria-label')).toBe(`Previous ${TEST_LABEL}`);
expect(prevA.getAttribute('aria-label')).toBe('Previous page');

const nextA = fixture.debugElement.query(By.css('.pagination-next > a')).nativeElement;
expect(nextA.innerText.replace(/\n/, '')).toContain(`Next ${TEST_LABEL}`);
expect(nextA.getAttribute('aria-label')).toBe(`Next ${TEST_LABEL}`);
expect(nextA.getAttribute('aria-label')).toBe('Next page');

const pageA = fixture.debugElement.queryAll(By.css('.ngx-pagination li > a'))[1].nativeElement;
expect(pageA.innerText.replace(/\n/, ' ')).toContain(`${TEST_LABEL} 1`);
Expand Down

0 comments on commit 979a1c5

Please sign in to comment.