Skip to content

Commit

Permalink
Temporarily remove the "refresh the session when 401 errors happen" (…
Browse files Browse the repository at this point in the history
…it will be restored by #5001)
  • Loading branch information
karreiro committed Dec 2, 2024
1 parent 4915786 commit f93ed1e
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions packages/cli-kit/src/public/node/themes/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 () => {
Expand Down

0 comments on commit f93ed1e

Please sign in to comment.