Skip to content

Commit

Permalink
Remove the "refresh the session when 401 errors happen"
Browse files Browse the repository at this point in the history
  • Loading branch information
karreiro authored Dec 2, 2024
1 parent 4915786 commit 11fd136
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 11fd136

Please sign in to comment.