Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the "refresh the session when 401 errors happen" #5005

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading