From f93ed1ead1e0ace8ed93fef5c08be6834ea6c925 Mon Sep 17 00:00:00 2001 From: Guilherme Carreiro Date: Mon, 2 Dec 2024 11:34:28 +0100 Subject: [PATCH] Temporarily remove the "refresh the session when 401 errors happen" (it will be restored by #5001) --- .../src/public/node/themes/api.test.ts | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/packages/cli-kit/src/public/node/themes/api.test.ts b/packages/cli-kit/src/public/node/themes/api.test.ts index 813d7e6f7bd..e74ba0159ba 100644 --- a/packages/cli-kit/src/public/node/themes/api.test.ts +++ b/packages/cli-kit/src/public/node/themes/api.test.ts @@ -356,7 +356,6 @@ describe('themeDelete', () => { describe('request errors', () => { test(`returns AbortError when graphql returns user error`, async () => { // Given - vi.mocked(adminRequestDoc).mockResolvedValue({ themeDelete: { deletedThemeId: null, @@ -371,31 +370,6 @@ describe('request errors', () => { // Then }).rejects.toThrowError(AbortError) }) - - test(`refresh the session when 401 errors happen`, async () => { - // Given - const id = 123 - const assets: AssetParams[] = [] - - vi.spyOn(session, 'refresh').mockImplementation(vi.fn()) - vi.mocked(restRequest) - .mockResolvedValueOnce({ - json: {}, - status: 401, - headers: {}, - }) - .mockResolvedValueOnce({ - json: {}, - status: 207, - headers: {}, - }) - - // When - await bulkUploadThemeAssets(id, assets, session) - - // Then - expect(session.refresh).toHaveBeenCalledOnce() - }) }) describe('bulkUploadThemeAssets', async () => {