Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
fix: apply PR requested cahnges
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Jan 29, 2024
1 parent 89449ff commit 82dcd5c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
24 changes: 14 additions & 10 deletions cypress/e2e/item/home/home.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ const translateBuilder = (key: string) =>

const sampleItems = generateOwnItems(30);

// register a custom one time interceptor to listen specifically
// to the request made with the search parameter we want
const interceptAccessibleItemsSearch = (searchTerm: string) =>
cy
.intercept({
pathname: `/${ITEMS_PATH}/accessible`,
query: { name: searchTerm },
})
.as('getAccessibleSearch');

describe('Home', () => {
describe('Grid', () => {
describe('Features', () => {
Expand Down Expand Up @@ -67,12 +77,8 @@ describe('Home', () => {

it('Search on second page should reset page number', () => {
const searchText = 'mysearch';
// register a custom one time interceptor to listen specifically
// to the request made with the search parameter we want
cy.intercept({
pathname: `/${ITEMS_PATH}/accessible`,
query: { name: searchText },
}).as('getAccessibleSearch');
interceptAccessibleItemsSearch(searchText);

cy.wait('@getAccessibleItems');
// navigate to seconde page
cy.get(`#${ITEMS_GRID_PAGINATION_ID} > ul > li`).eq(2).click();
Expand Down Expand Up @@ -280,10 +286,8 @@ describe('Home', () => {

it('Search on second page should reset page number', () => {
const searchText = 'mysearch';
cy.intercept({
pathname: `/${ITEMS_PATH}/accessible`,
query: { name: searchText },
}).as('getAccessibleSearch');
interceptAccessibleItemsSearch(searchText);

cy.wait('@getAccessibleItems');
// navigate to second page
cy.get(ACCESSIBLE_ITEMS_NEXT_PAGE_BUTTON_SELECTOR).click();
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/CropModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const CropModal = ({
>
<img
ref={imageRef}
alt="Crop me"
alt={t(BUILDER.CROP_IMAGE_MODAL_IMAGE_ALT_TEXT)}
width="100%"
height="100%"
src={src}
Expand Down
1 change: 1 addition & 0 deletions src/langs/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const BUILDER = {
CREATE_SHORTCUT_MODAL_TITLE: 'CREATE_SHORTCUT_MODAL_TITLE',
CROP_IMAGE_MODAL_CONTENT_TEXT: 'CROP_IMAGE_MODAL_CONTENT_TEXT',
CROP_IMAGE_MODAL_TITLE: 'CROP_IMAGE_MODAL_TITLE',
CROP_IMAGE_MODAL_IMAGE_ALT_TEXT: 'CROP_IMAGE_MODAL_IMAGE_ALT_TEXT',
DELETE_BUTTON: 'DELETE_BUTTON',
DELETE_ITEM_MODAL_CONFIRM_BUTTON: 'DELETE_ITEM_MODAL_CONFIRM_BUTTON',
DELETE_ITEM_MODAL_CONTENT: 'DELETE_ITEM_MODAL_CONTENT',
Expand Down
1 change: 1 addition & 0 deletions src/langs/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"CREATE_SHORTCUT_MODAL_TITLE": "Where do you want to create the shortcut?",
"CROP_IMAGE_MODAL_CONTENT_TEXT": "Crop your chosen image to fit the image size requirements.",
"CROP_IMAGE_MODAL_TITLE": "Crop Image",
"CROP_IMAGE_MODAL_IMAGE_ALT_TEXT": "Crop me",
"DELETE_BUTTON": "Delete",
"DELETE_ITEM_MODAL_CONFIRM_BUTTON": "Delete Permanently",
"DELETE_ITEM_MODAL_CONTENT_one": "This item will be deleted permanently.",
Expand Down

0 comments on commit 82dcd5c

Please sign in to comment.