From 2927b7b8f3fde6c089a9e25d3a2a67bad06e0004 Mon Sep 17 00:00:00 2001 From: Rustin170506 <29879298+Rustin170506@users.noreply.github.com> Date: Tue, 29 Oct 2024 00:03:53 +0800 Subject: [PATCH] Update the e2e test as well Signed-off-by: Rustin170506 <29879298+Rustin170506@users.noreply.github.com> --- e2e/acceptance/sudo.spec.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/e2e/acceptance/sudo.spec.ts b/e2e/acceptance/sudo.spec.ts index 8bc9813b61..5ba65a6e5f 100644 --- a/e2e/acceptance/sudo.spec.ts +++ b/e2e/acceptance/sudo.spec.ts @@ -112,9 +112,23 @@ test.describe('Acceptance | sudo', { tag: '@acceptance' }, () => { await yankButton.click(); + // Verify backend state after yanking + const yankedVersion = await page.evaluate(() => { + const crate = server.schema['crates'].findBy({ name: 'foo' }); + return server.schema['versions'].findBy({ crateId: crate.id, num: '0.1.0', yanked: true }); + }); + expect(yankedVersion, 'The version should be yanked').toBeTruthy(); + await expect(unyankButton).toBeVisible(); await unyankButton.click(); + // Verify backend state after unyanking + const unyankedVersion = await page.evaluate(() => { + const crate = server.schema['crates'].findBy({ name: 'foo' }); + return server.schema['versions'].findBy({ crateId: crate.id, num: '0.1.0', yanked: false }); + }); + expect(unyankedVersion, 'The version should be unyanked').toBeTruthy(); + await expect(yankButton).toBeVisible(); }); });