2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-04-04 10:31:03 +00:00

[API] Category star fix (#11588)

* [API] Bug fix for PartStar and PartCategoryStar

- Logic refactor and fixes

* Add playwright tests

* Remove debug statements

* Revert API string changes
This commit is contained in:
Oliver
2026-03-21 23:47:11 +11:00
committed by GitHub
parent cf619b4184
commit 8e289a3208
3 changed files with 54 additions and 40 deletions

View File

@@ -97,6 +97,38 @@ test('Parts - Image Selection', async ({ browser }) => {
await page.getByText('The image has been removed successfully').waitFor();
});
// Test subscription logic for parts and categories
test('Parts - Subscriptions', async ({ browser }) => {
const page = await doCachedLogin(browser, { url: 'part/category/3/parts' });
// Click to subscribe to this category
await page
.getByRole('button', { name: 'action-button-subscribe-to-' })
.click();
await page.getByText('Subscription added').waitFor();
// Click to unsubscribe from this category
await page
.getByRole('button', { name: 'action-button-unsubscribe-' })
.click();
await page.getByText('Subscription removed').waitFor();
// Navigate through to a part detail page
await page.getByRole('cell', { name: 'Thumbnail M3x10 FHS-PLA' }).click();
// Click to subscribe to this part
await page
.getByRole('button', { name: 'action-button-subscribe-to-' })
.click();
await page.getByText('Subscription added').waitFor();
// Click to unsubscribe from this part
await page
.getByRole('button', { name: 'action-button-unsubscribe-' })
.click();
await page.getByText('Subscription removed').waitFor();
});
test('Parts - Manufacturer Parts', async ({ browser }) => {
const page = await doCachedLogin(browser, { url: 'part/84/' });