diff --git a/admin-ui/cypress.config.ts b/admin-ui/cypress.config.ts index ab4c12f186..94baf4cbc1 100644 --- a/admin-ui/cypress.config.ts +++ b/admin-ui/cypress.config.ts @@ -4,8 +4,8 @@ export default defineConfig({ defaultCommandTimeout: 5000, retries: { - runMode: 3, - openMode: 2, + runMode: 2, + openMode: 1, }, e2e: { @@ -14,8 +14,8 @@ export default defineConfig({ baseUrl: 'http://localhost:3000', supportFile: 'cypress/support/e2e.ts', retries: { - openMode: 2, - runMode: 3, + openMode: 1, + runMode: 1, }, }, diff --git a/admin-ui/cypress/e2e/account.cy.ts b/admin-ui/cypress/e2e/account.cy.ts index 1bd20f94f2..aa8a2c1571 100644 --- a/admin-ui/cypress/e2e/account.cy.ts +++ b/admin-ui/cypress/e2e/account.cy.ts @@ -269,7 +269,7 @@ describe('Account', () => { .contains(localizations.en.send_verification_mail) .should('be.visible'); - cy.get('button#delete_button').should('be.visible'); + cy.get('button.border-rose-500').should('be.visible'); }); it('Should [SEND VERIFICATION EMAIL] successfully', () => { @@ -296,7 +296,7 @@ describe('Account', () => { it('Should [DELETE EMAIL] successfully', () => { const { me: currentUser } = CurrentUserResponse.data; - cy.get('button#delete_button').first().click(); + cy.get('button.border-rose-500').eq(1).click(); cy.get('button#danger_continue') .contains(localizations.en.delete_email) diff --git a/admin-ui/cypress/e2e/assortment-media.cy.ts b/admin-ui/cypress/e2e/assortment-media.cy.ts index e0ecf49759..02f33ef46f 100644 --- a/admin-ui/cypress/e2e/assortment-media.cy.ts +++ b/admin-ui/cypress/e2e/assortment-media.cy.ts @@ -147,7 +147,7 @@ describe('Assortment Detail Media', () => { }); it('Should [DELETE] media successfully', () => { - cy.get('button#delete_button').first().click({ force: true }); + cy.get('li button.border-rose-500').first().click({ force: true }); cy.get('button[type="button"]#danger_continue') .contains(localizations.en.delete_assortment_media) .click(); @@ -175,7 +175,7 @@ describe('Assortment Detail Media', () => { }); it('Should [CANCEL] delete media successfully', () => { - cy.get('button#delete_button').first().click({ force: true }); + cy.get('li button.border-rose-500').first().click({ force: true }); cy.get('button[type="button"]#danger_cancel') .contains(localizations.en.cancel) .click(); @@ -186,7 +186,7 @@ describe('Assortment Detail Media', () => { TranslatedAssortmentMediaTextsResponse.data .translatedAssortmentMediaTexts; - cy.get('button#edit').first().click(); + cy.get('button.bg-transparent.border-transparent').first().click(); cy.get('input#title').should('have.value', firstText.title); cy.get('input#subtitle').should('have.value', firstText.subtitle); }); @@ -197,7 +197,7 @@ describe('Assortment Detail Media', () => { .translatedAssortmentMediaTexts; cy.selectLocale(1); - cy.get('button#edit').first().click(); + cy.get('button.bg-transparent.border-transparent').first().click(); cy.get('input#title').should('have.value', secondTexts.title); cy.get('input#subtitle').should('have.value', secondTexts.subtitle); }); @@ -207,7 +207,7 @@ describe('Assortment Detail Media', () => { TranslatedAssortmentMediaTextsResponse.data .translatedAssortmentMediaTexts; - cy.get('button#edit').first().click(); + cy.get('button.bg-transparent.border-transparent').first().click(); cy.get('input#title').clear().type(firstText.title); cy.get('input#subtitle').clear().type(firstText.subtitle); @@ -239,7 +239,7 @@ describe('Assortment Detail Media', () => { cy.selectLocale(1); cy.get('select#locale-wrapper').should('not.have.value', ''); - cy.get('button#edit').first().click(); + cy.get('button.bg-transparent.border-transparent').first().click(); cy.get('input#title').clear().type(secondTexts.title); cy.get('input#subtitle').clear().type(secondTexts.subtitle); @@ -259,7 +259,7 @@ describe('Assortment Detail Media', () => { }); it('Should [CANCEL] in media texts update form', () => { - cy.get('button#edit').first().click(); + cy.get('button.bg-transparent.border-transparent').first().click(); cy.get('input#title').clear().type('title'); cy.get('button[type="button"][data-id="cancel_update"]') .contains(localizations.en.cancel) diff --git a/admin-ui/cypress/e2e/country.cy.ts b/admin-ui/cypress/e2e/country.cy.ts index c46ba65b31..0a200ff5ff 100644 --- a/admin-ui/cypress/e2e/country.cy.ts +++ b/admin-ui/cypress/e2e/country.cy.ts @@ -265,7 +265,7 @@ describe('Countries', () => { .click({ force: true }); cy.get('button').contains(localizations.en.edit).click(); cy.url().should('include', `/country/?countryId=${country._id}`); - cy.get('button[aria-describedby="header-delete-button"]') + cy.get('button') .contains(localizations.en.delete) .click(); cy.get('button#danger_continue') diff --git a/admin-ui/cypress/e2e/currency.cy.ts b/admin-ui/cypress/e2e/currency.cy.ts index 97ba461c1d..7a5097bcea 100644 --- a/admin-ui/cypress/e2e/currency.cy.ts +++ b/admin-ui/cypress/e2e/currency.cy.ts @@ -325,7 +325,7 @@ describe('Currencies', () => { .click({ force: true }); cy.get('button').contains(localizations.en.edit).click(); cy.url().should('include', `/currency/?currencyId=${currency._id}`); - cy.get('button[aria-describedby="header-delete-button"]') + cy.get('button') .contains(localizations.en.delete) .click(); cy.get('button#danger_continue') diff --git a/admin-ui/cypress/e2e/filter.cy.ts b/admin-ui/cypress/e2e/filter.cy.ts index 9a9f3033e1..3bf9b33571 100644 --- a/admin-ui/cypress/e2e/filter.cy.ts +++ b/admin-ui/cypress/e2e/filter.cy.ts @@ -114,28 +114,15 @@ describe('Filter', () => { it('Toggling status [ACTIVE/INACTIVE] toggle should update route', () => { cy.get('button[role="switch"]').click(); - cy.location().then((current) => { + cy.location().should((current) => { expect(current.pathname).to.eq('/filters/'); expect(convertURLSearchParamToObj(current.search)).to.deep.eq({ includeInactive: 'false', }); }); - cy.wait(fullAliasName(FilterOperations.GetFiltersList)).then( - (currentSubject) => { - const { request } = currentSubject; - expect(request.body.variables.includeInactive).to.eq(false); - }, - ); - cy.get('button[role="switch"]').click(); - cy.wait(fullAliasName(FilterOperations.GetFiltersList)).then( - (currentSubject) => { - const { request } = currentSubject; - expect(request.body.variables.includeInactive).to.eq(true); - }, - ); - cy.location().then((current) => { + cy.location().should((current) => { expect(current.pathname).to.eq('/filters/'); expect(convertURLSearchParamToObj(current.search)).to.deep.eq({ includeInactive: 'true', @@ -531,7 +518,7 @@ describe('Filter', () => { ); cy.get('input[name="key"]').type(SingleFilterResponse.data.filter.key); cy.get('select[name="type"]').select(firstFilterType.value); - cy.get(`button[aria-label="${localizations.en.delete}"]`).click(); + cy.get('button.border-rose-500').first().click(); cy.get('input[type="submit"]') .contains(localizations.en.create_filter) .click(); @@ -608,7 +595,7 @@ describe('Filter', () => { ); cy.get('input[name="key"]').type(SingleFilterResponse.data.filter.key); cy.get('select[name="type"]').select(firstFilterType.value); - cy.get(`button[aria-label="${localizations.en.delete}"]`).click(); + cy.get('button.border-rose-500').first().click(); cy.get('input[type="submit"]') .contains(localizations.en.create_filter) .click(); diff --git a/admin-ui/cypress/e2e/language.cy.ts b/admin-ui/cypress/e2e/language.cy.ts index 164c116913..66e65a5a5c 100644 --- a/admin-ui/cypress/e2e/language.cy.ts +++ b/admin-ui/cypress/e2e/language.cy.ts @@ -212,7 +212,7 @@ describe('Languages', () => { cy.location('pathname').should('eq', '/language/'); cy.visit(`/language?languageId=${language._id}`); cy.url().should('include', `/language/?languageId=${language._id}`); - cy.get('button[aria-describedby="header-delete-button"]') + cy.get('button') .contains(localizations.en.delete) .click(); cy.get('button#danger_continue') diff --git a/admin-ui/cypress/e2e/order.cy.ts b/admin-ui/cypress/e2e/order.cy.ts index 5c007f775f..eb2cf5ec18 100644 --- a/admin-ui/cypress/e2e/order.cy.ts +++ b/admin-ui/cypress/e2e/order.cy.ts @@ -260,36 +260,6 @@ describe('Order', () => { }, ); - cy.wait(fullAliasName(OrderOperations.OrderDeliveryStatus)).then( - (currentSubject) => { - expect(currentSubject.response.body).to.deep.eq( - OrderDeliveryStatusResponse, - ); - }, - ); - - cy.wait(fullAliasName(OrderOperations.PaymentProvidersType)).then( - (currentSubject) => { - expect(currentSubject.response.body).to.deep.eq( - PaymentProvidersTypeResponse, - ); - }, - ); - - cy.wait(fullAliasName(OrderOperations.OrderStatus)).then( - (currentSubject) => { - expect(currentSubject.response.body).to.deep.eq(OrderStatusResponse); - }, - ); - - cy.wait(fullAliasName(OrderOperations.OrderPaymentStatus)).then( - (currentSubject) => { - expect(currentSubject.response.body).to.deep.eq( - OrderPaymentStatusResponse, - ); - }, - ); - cy.url().should('include', `/orders/?orderId=${order._id}`); cy.get('h2').should('contain.text', localizations.en.order); }); diff --git a/admin-ui/cypress/e2e/product-assignment.cy.ts b/admin-ui/cypress/e2e/product-assignment.cy.ts index 373a8a2621..8a9de84bc9 100644 --- a/admin-ui/cypress/e2e/product-assignment.cy.ts +++ b/admin-ui/cypress/e2e/product-assignment.cy.ts @@ -151,9 +151,7 @@ describe('Product Assignment', () => { }); it('Should [REMOVE productASSIGNMENT ] successfully', () => { - cy.get( - `button[type=button][aria-label="${localizations.en.delete}"]#delete_button`, - ).first().click(); + cy.get('button.border-rose-500').first().click(); cy.get('[aria-modal="true"]').should('exist'); cy.get('button[type="button"]#danger_continue') .should('contain.text', localizations.en.delete_variation_assignment) diff --git a/admin-ui/cypress/e2e/product-media.cy.ts b/admin-ui/cypress/e2e/product-media.cy.ts index 3be616f1d4..5cccca995b 100644 --- a/admin-ui/cypress/e2e/product-media.cy.ts +++ b/admin-ui/cypress/e2e/product-media.cy.ts @@ -141,7 +141,7 @@ describe('Product Media', () => { }); it('Should [DELETE] media successfully', () => { - cy.get('button#delete_button').first().click({ force: true }); + cy.get('button.border-rose-500').first().click({ force: true }); cy.get('button[type="button"]#danger_continue') .contains(localizations.en.delete_product_media) .click(); @@ -176,7 +176,7 @@ describe('Product Media', () => { }); it('Should [CANCEL] delete media successfully', () => { - cy.get('button#delete_button').first().click({ force: true }); + cy.get('button.border-rose-500').first().click({ force: true }); cy.get('button[type="button"]#danger_cancel') .contains(localizations.en.cancel) .click(); @@ -194,7 +194,7 @@ describe('Product Media', () => { const { translatedProductMediaTexts: mediaTexts } = TranslatedProductMediaTextsResponse.data; - cy.get('div#edit__icon_button').first().click(); + cy.get('button.bg-transparent.border-transparent').first().click(); cy.get('input#title').clear().type(mediaTexts[0].title); cy.get('input#subtitle').clear().type(mediaTexts[0].subtitle); @@ -239,7 +239,7 @@ describe('Product Media', () => { }); it('Should [CANCEL] in media texts update form', () => { - cy.get('div#edit__icon_button').first().click(); + cy.get('button.bg-transparent.border-transparent').first().click(); cy.get('input#title').clear().type('title'); cy.get('button[type="button"][data-id="cancel_update"]') .contains(localizations.en.cancel) diff --git a/admin-ui/cypress/e2e/product-variation.cy.ts b/admin-ui/cypress/e2e/product-variation.cy.ts index 347ebeb7f6..8f3145f186 100644 --- a/admin-ui/cypress/e2e/product-variation.cy.ts +++ b/admin-ui/cypress/e2e/product-variation.cy.ts @@ -220,7 +220,7 @@ describe('Product Variation', () => { cy.get('.variation-display').first().within(() => { cy.get('button').last().click({ force: true }); }); - cy.get('.fixed.w-48 button').contains(localizations.en.delete).click(); + cy.get('.fixed.w-48 button').contains(localizations.en.delete).click({ force: true }); cy.get('div[aria-modal="true"]').should('exist'); cy.get('#danger_continue') .should('contain.text', localizations.en.delete_product_variation) @@ -240,7 +240,7 @@ describe('Product Variation', () => { cy.get('.variation-display').first().within(() => { cy.get('button').last().click({ force: true }); }); - cy.get('.fixed.w-48 button').contains(localizations.en.delete).click(); + cy.get('.fixed.w-48 button').contains(localizations.en.delete).click({ force: true }); cy.get('div[aria-modal="true"]').should('exist'); cy.get('#danger_cancel') .should('contain.text', localizations.en.cancel) @@ -254,7 +254,7 @@ describe('Product Variation', () => { cy.get('.variation-display').first().within(() => { cy.get('button').last().click({ force: true }); }); - cy.get('.fixed.w-48 button').contains(localizations.en.edit).click(); + cy.get('.fixed.w-48 button').contains(localizations.en.edit).click({ force: true }); cy.get('form.variation-update-form input[name="title"]') .should('have.value', firstVariation.texts.title); @@ -270,7 +270,7 @@ describe('Product Variation', () => { cy.get('.variation-display').first().within(() => { cy.get('button').last().click({ force: true }); }); - cy.get('.fixed.w-48 button').contains(localizations.en.edit).click(); + cy.get('.fixed.w-48 button').contains(localizations.en.edit).click({ force: true }); cy.get('form.variation-update-form input[name="title"]') .clear() @@ -301,7 +301,7 @@ describe('Product Variation', () => { cy.get('.variation-display').first().within(() => { cy.get('button').last().click({ force: true }); }); - cy.get('.fixed.w-48 button').contains(localizations.en.edit).click(); + cy.get('.fixed.w-48 button').contains(localizations.en.edit).click({ force: true }); cy.get('form.variation-update-form input[name="title"]') .clear() @@ -361,5 +361,82 @@ describe('Product Variation', () => { .should('have.value', localizations.en.add_option) .should('be.disabled'); }); + + it('Should [UPDATE VARIATION OPTION TEXT] successfully', () => { + const [firstOption] = firstVariation.options; + cy.get('.variation-display').first().click(); + + cy.get('form.variation-option-update-form button[aria-label="Actions menu"]').first().click({ force: true }); + cy.get('.fixed.w-48 button').contains(localizations.en.edit).click({ force: true }); + + cy.get('form.variation-option-update-form input[name="title"]') + .clear() + .type('updated option title'); + cy.get('form.variation-option-update-form input[name="subtitle"]') + .clear() + .type('updated option subtitle'); + cy.get('form.variation-option-update-form button[type="submit"]') + .contains(localizations.en.save) + .click(); + + cy.wait( + fullAliasMutationName(ProductOperations.UpdateProductVariationTexts), + ).then((currentSubject) => { + const { request, response } = currentSubject; + expect(request.body.variables.productVariationId).to.eq(firstVariation._id); + expect(request.body.variables.productVariationOptionValue).to.eq(firstOption.value); + expect(request.body.variables.texts[0].title).to.eq('updated option title'); + expect(request.body.variables.texts[0].subtitle).to.eq('updated option subtitle'); + expect(response.body).to.deep.eq(UpdateProductVariationTextResponse); + }); + }); + + it('Should [CANCEL UPDATE VARIATION OPTION] successfully', () => { + cy.get('.variation-display').first().click(); + + cy.get('form.variation-option-update-form button[aria-label="Actions menu"]').first().click({ force: true }); + cy.get('.fixed.w-48 button').contains(localizations.en.edit).click({ force: true }); + + cy.get('form.variation-option-update-form input[name="title"]') + .clear() + .type('updated option title'); + cy.get('form.variation-option-update-form button[type="button"]') + .contains(localizations.en.cancel) + .click(); + + cy.get('form.variation-option-update-form input[name="title"]').should('not.exist'); + }); + + it('Should [REMOVE VARIATION OPTION] successfully', () => { + const [firstOption] = firstVariation.options; + cy.get('.variation-display').first().click(); + + cy.get('form.variation-option-update-form button[aria-label="Actions menu"]').first().click({ force: true }); + cy.get('.fixed.w-48 button').contains(localizations.en.delete).click({ force: true }); + + cy.get('button#danger_continue') + .should('contain.text', localizations.en.delete_variation_option) + .click(); + + cy.wait( + fullAliasMutationName(ProductOperations.RemoveProductVariationOption), + ).then((currentSubject) => { + const { request, response } = currentSubject; + expect(request.body.variables.productVariationId).to.eq(firstVariation._id); + expect(request.body.variables.productVariationOptionValue).to.eq(firstOption.value); + expect(response.body).to.deep.eq(RemoveProductVariationOptionResponse); + }); + }); + + it('Should [CANCEL REMOVING VARIATION OPTION] successfully', () => { + cy.get('.variation-display').first().click(); + + cy.get('form.variation-option-update-form button[aria-label="Actions menu"]').first().click({ force: true }); + cy.get('.fixed.w-48 button').contains(localizations.en.delete).click({ force: true }); + + cy.get('button#danger_cancel') + .should('contain.text', localizations.en.cancel) + .click(); + }); }); }); diff --git a/admin-ui/cypress/e2e/product.cy.ts b/admin-ui/cypress/e2e/product.cy.ts index 60d0d53321..2f5c0d4ff6 100644 --- a/admin-ui/cypress/e2e/product.cy.ts +++ b/admin-ui/cypress/e2e/product.cy.ts @@ -31,8 +31,11 @@ const ProductTypes = { TokenizedProduct: 'TOKENIZED_PRODUCT', }; +let productTypeOverride: string | null = null; + describe('Product', () => { beforeEach(() => { + productTypeOverride = null; cy.intercept('POST', '/graphql', (req) => { const { body } = req; if (hasOperationName(req, LanguageOperations.GetLanguagesList)) { @@ -43,11 +46,14 @@ describe('Product', () => { req.reply(ProductListResponse); } if (hasOperationName(req, ProductOperations.GetSingleProduct)) { + const foundProduct = ProductListResponse.data.products.find( + ({ _id }) => _id === body.variables.productId, + ); req.reply({ data: { - product: ProductListResponse.data.products.find( - ({ _id }) => _id === body.variables.productId, - ), + product: productTypeOverride + ? { ...foundProduct, __typename: productTypeOverride } + : foundProduct, }, }); } @@ -423,18 +429,14 @@ describe('Product', () => { it('Delete product button should be visible for unpublished/draft product', () => { cy.get(`a[href="/products/?slug=${DRAFT_PRODUCT_SLUG}"]`).first().click(); - cy.get( - 'button[aria-describedby="header-delete-button"]', - ) + cy.get('button').contains(localizations.en.delete) .contains(localizations.en.delete) .should('be.visible'); }); it('Delete product button should [NOT] be visible for published product', () => { cy.get(`a[href="/products/?slug=${ACTIVE_PRODUCT_SLUG}"]`).first().click(); - cy.get( - 'button[aria-describedby="header-delete-button"]', - ).should('not.exist'); + cy.get('button').contains(localizations.en.delete).should('not.exist'); }); it('[UNPUBLISH] product successfully', () => { @@ -464,9 +466,7 @@ describe('Product', () => { cy.get(`a[href="/products/?slug=${generateUniqueId(firstProduct)}"]`) .first() .click(); - cy.get( - 'button[aria-describedby="header-delete-button"]', - ).click(); + cy.get('button').contains(localizations.en.delete).click(); cy.get('button#danger_continue') .should('contain.text', localizations.en.continue) @@ -492,9 +492,7 @@ describe('Product', () => { cy.get(`a[href="/products/?slug=${generateUniqueId(firstProduct)}"]`) .first() .click(); - cy.get( - 'button[aria-describedby="header-delete-button"]', - ).click(); + cy.get('button').contains(localizations.en.delete).click(); cy.get('button#danger_cancel') .should('contain.text', localizations.en.cancel) @@ -526,41 +524,66 @@ describe('Product', () => { }); context('Displayed tabs for types', () => { - beforeEach(() => { + it('SimpleProduct should show texts, media, commerce, supply, warehousing tabs', () => { + productTypeOverride = 'SimpleProduct'; cy.get(`a[href="/products/?slug=${DRAFT_PRODUCT_SLUG}"]`).first().click(); - }); - it('SimpleProduct', () => { cy.get('a#texts').should('contain.text', localizations.en.text); cy.get('a#media').should('contain.text', localizations.en.media); cy.get('a#commerce').should('contain.text', localizations.en.commerce); cy.get('a#supply').should('contain.text', localizations.en.supply); - cy.get('a#warehousing').should( - 'contain.text', - localizations.en.warehousing, - ); - /* Tabs not applicable to this product type */ + cy.get('a#warehousing').should('contain.text', localizations.en.warehousing); + cy.get('a#variations').should('not.exist'); + cy.get('a#assignments').should('not.exist'); + cy.get('a#subscriptions').should('not.exist'); + cy.get('a#bundled_products').should('not.exist'); }); - it('ConfigurableProduct', () => { + it('ConfigurableProduct should show texts, media, variations, assignments tabs', () => { + productTypeOverride = 'ConfigurableProduct'; + cy.get(`a[href="/products/?slug=${DRAFT_PRODUCT_SLUG}"]`).first().click(); cy.get('a#texts').should('contain.text', localizations.en.text); cy.get('a#media').should('contain.text', localizations.en.media); + cy.get('a#variations').should('contain.text', localizations.en.variations); + cy.get('a#assignments').should('contain.text', localizations.en.assignments); + cy.get('a#commerce').should('not.exist'); + cy.get('a#supply').should('not.exist'); + cy.get('a#warehousing').should('not.exist'); }); - it('PlanProduct', () => { + it('PlanProduct should show texts, media, commerce, subscriptions tabs', () => { + productTypeOverride = 'PlanProduct'; + cy.get(`a[href="/products/?slug=${DRAFT_PRODUCT_SLUG}"]`).first().click(); cy.get('a#texts').should('contain.text', localizations.en.text); cy.get('a#media').should('contain.text', localizations.en.media); cy.get('a#commerce').should('contain.text', localizations.en.commerce); + cy.get('a#subscriptions').should('contain.text', localizations.en.subscriptions); + cy.get('a#variations').should('not.exist'); + cy.get('a#supply').should('not.exist'); + cy.get('a#warehousing').should('not.exist'); }); - it('BundleProduct', () => { + it('BundleProduct should show texts, media, commerce, bundled_products tabs', () => { + productTypeOverride = 'BundleProduct'; + cy.get(`a[href="/products/?slug=${DRAFT_PRODUCT_SLUG}"]`).first().click(); cy.get('a#texts').should('contain.text', localizations.en.text); cy.get('a#media').should('contain.text', localizations.en.media); cy.get('a#commerce').should('contain.text', localizations.en.commerce); + cy.get('a#bundled_products').should('contain.text', localizations.en.bundled_items); + cy.get('a#variations').should('not.exist'); + cy.get('a#supply').should('not.exist'); + cy.get('a#warehousing').should('not.exist'); }); - it('TokenizedProduct', () => { + + it('TokenizedProduct should show texts, media, commerce, token tabs', () => { + productTypeOverride = 'TokenizedProduct'; + cy.get(`a[href="/products/?slug=${DRAFT_PRODUCT_SLUG}"]`).first().click(); cy.get('a#texts').should('contain.text', localizations.en.text); cy.get('a#media').should('contain.text', localizations.en.media); cy.get('a#commerce').should('contain.text', localizations.en.commerce); + cy.get('a#token').should('contain.text', localizations.en.token); + cy.get('a#variations').should('not.exist'); + cy.get('a#supply').should('not.exist'); + cy.get('a#warehousing').should('not.exist'); }); }); }); diff --git a/admin-ui/cypress/e2e/user-account.cy.ts b/admin-ui/cypress/e2e/user-account.cy.ts index 721386ae0a..a99c895872 100644 --- a/admin-ui/cypress/e2e/user-account.cy.ts +++ b/admin-ui/cypress/e2e/user-account.cy.ts @@ -194,7 +194,7 @@ describe('User', () => { .contains(localizations.en.send_verification_mail) .should('be.visible'); } - cy.get('button#delete_button').should('be.visible'); + cy.get('button.border-rose-500').should('be.visible'); }); }); @@ -226,7 +226,7 @@ describe('User', () => { }); it('Should [DELETE EMAIL] successfully', () => { - cy.get('button#delete_button').first().click(); + cy.get('button.border-rose-500').eq(1).click(); cy.get('button#danger_continue') .contains(localizations.en.delete_email) diff --git a/admin-ui/eslint.config.mjs b/admin-ui/eslint.config.mjs index fb2d73bcc9..fb0a20e4fb 100644 --- a/admin-ui/eslint.config.mjs +++ b/admin-ui/eslint.config.mjs @@ -98,6 +98,153 @@ export default [ ...nextPlugin.configs['core-web-vitals'].rules, '@next/next/no-img-element': 'warn', '@next/next/no-sync-scripts': 'warn', + + // Prevent importing moved primitives from old locations + 'no-restricted-imports': [ + 'error', + { + patterns: [ + { + group: ['**/common/components/Button'], + message: 'Use @/components/ui/Button', + }, + { + group: ['**/common/components/Badge'], + message: 'Use @/components/ui/Badge', + }, + { + group: ['**/common/components/Toggle'], + message: 'Use @/components/ui/Toggle', + }, + { + group: ['**/common/components/Loading'], + message: 'Use @/components/ui/Loading', + }, + { + group: ['**/common/components/NoData'], + message: 'Use @/components/ui/NoData', + }, + { + group: ['**/common/components/BlockingContent'], + message: 'Use @/components/ui/BlockingContent', + }, + { + group: ['**/common/components/SearchField'], + message: 'Use @/components/ui/SearchField', + }, + { + group: ['**/common/components/CopyableText'], + message: 'Use @/components/ui/CopyableText', + }, + { + group: ['**/common/components/Tab'], + message: 'Use @/components/ui/Tab', + }, + { + group: ['**/common/components/BreadCrumbs'], + message: 'Use @/components/ui/BreadCrumbs', + }, + { + group: ['**/common/components/PageHeader'], + message: 'Use @/components/ui/PageHeader', + }, + { + group: ['**/common/components/ListHeader'], + message: 'Use @/components/ui/ListHeader', + }, + { + group: ['**/common/components/DetailHeader'], + message: 'Use @/components/ui/DetailHeader', + }, + { + group: ['**/common/components/JSONView'], + message: 'Use @/components/ui/JSONView', + }, + { + group: ['**/common/components/Pagination'], + message: 'Use @/components/ui/Pagination', + }, + { + group: ['**/common/components/ToolTip'], + message: 'Use @/components/ui/ToolTip', + }, + { + group: ['**/common/components/ErrorBoundary'], + message: 'Use @/components/ui/ErrorBoundary', + }, + { + group: ['**/common/components/ErrorFallback'], + message: 'Use @/components/ui/ErrorFallback', + }, + { + group: ['**/common/components/DateInput'], + message: 'Use @/components/ui/DateInput', + }, + { + group: ['**/common/components/DateRangeFilterInput'], + message: 'Use @/components/ui/DateRangeFilterInput', + }, + { + group: ['**/common/components/AnimatedCounter'], + message: 'Use @/components/ui/AnimatedCounter', + }, + { + group: ['**/common/components/HelpText'], + message: 'Use @/components/ui/HelpText', + }, + { + group: ['**/common/components/InfoTextBanner'], + message: 'Use @/components/ui/InfoTextBanner', + }, + { + group: ['**/common/components/SaveAndCancelButtons'], + message: 'Use @/components/ui/SaveAndCancelButtons', + }, + { + group: ['**/common/components/ActiveInActive'], + message: 'Use @/components/ui/ActiveInActive', + }, + { + group: ['**/common/components/ImageWithFallback'], + message: 'Use @/components/ui/ImageWithFallback', + }, + { + group: ['**/common/components/NoImage'], + message: 'Use @/components/ui/NoImage', + }, + { + group: ['**/common/components/DraggableIcon'], + message: 'Use @/components/ui/DraggableIcon', + }, + { + group: ['**/common/components/Accordion*'], + message: 'Use @/components/ui/Accordion/*', + }, + { + group: ['**/common/components/TagInput', '**/common/components/TagList*'], + message: 'Use @/components/ui/Tag/*', + }, + { + group: ['**/common/components/Portal*'], + message: 'Use @/components/ui/Portal/*', + }, + { + group: ['**/forms/components/TextField', '**/forms/components/TextAreaField', '**/forms/components/SelectField', '**/forms/components/CheckboxField', '**/forms/components/ChoicesField', '**/forms/components/DatePickerField', '**/forms/components/EmailField', '**/forms/components/PasswordField', '**/forms/components/JSONAreaField', '**/forms/components/MarkdownTextAreaField', '**/forms/components/TagInputField', '**/forms/components/FieldWrapper', '**/forms/components/FormErrors', '**/forms/components/SubmitButton', '**/forms/components/FieldWithHelp'], + message: 'Use @/components/ui/form/*', + }, + { + group: ['**/common/components/DeleteButton', '**/common/components/HeaderDeleteButton', '**/common/components/EditIcon'], + message: 'Deleted — use