Skip to content

Commit 0a54039

Browse files
Fix rate limit test by avoiding popup side effects and clearing cache
Use options.html instead of popup.html in test storage helpers to prevent the popup from auto-fetching issue data via REST API. Clear issue_cache before each Error Handling test to prevent cached data from masking rate limit errors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6b85aa3 commit 0a54039

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

tests/extension.spec.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ test.describe('', () => {
988988
// Helper to add bookmarks in auth context
989989
async function addAuthBookmarks(bookmarks) {
990990
const tempPage = await authContext.newPage();
991-
await tempPage.goto(`chrome-extension://${authExtensionId}/assets/popup.html`);
991+
await tempPage.goto(`chrome-extension://${authExtensionId}/assets/options.html`);
992992
await tempPage.evaluate((bookmarks) => {
993993
return new Promise((resolve) => {
994994
chrome.storage.sync.set({ bookmarked_issues: bookmarks }, resolve);
@@ -1000,7 +1000,7 @@ test.describe('', () => {
10001000
// Helper to clear bookmarks in auth context
10011001
async function clearAuthBookmarks() {
10021002
const tempPage = await authContext.newPage();
1003-
await tempPage.goto(`chrome-extension://${authExtensionId}/assets/popup.html`);
1003+
await tempPage.goto(`chrome-extension://${authExtensionId}/assets/options.html`);
10041004
await tempPage.evaluate(() => {
10051005
return new Promise((resolve) => {
10061006
chrome.storage.sync.clear(resolve);
@@ -1137,7 +1137,7 @@ test.describe('', () => {
11371137
// Helper to add bookmarks in auth context
11381138
async function addAuthBookmarks(bookmarks) {
11391139
const tempPage = await authContext.newPage();
1140-
await tempPage.goto(`chrome-extension://${authExtensionId}/assets/popup.html`);
1140+
await tempPage.goto(`chrome-extension://${authExtensionId}/assets/options.html`);
11411141
await tempPage.evaluate((bookmarks) => {
11421142
return new Promise((resolve) => {
11431143
chrome.storage.sync.set({ bookmarked_issues: bookmarks }, resolve);
@@ -1146,6 +1146,17 @@ test.describe('', () => {
11461146
await tempPage.close();
11471147
}
11481148

1149+
test.beforeEach(async () => {
1150+
const tempPage = await authContext.newPage();
1151+
await tempPage.goto(`chrome-extension://${authExtensionId}/assets/options.html`);
1152+
await tempPage.evaluate(() => {
1153+
return new Promise((resolve) => {
1154+
chrome.storage.local.remove('issue_cache', resolve);
1155+
});
1156+
});
1157+
await tempPage.close();
1158+
});
1159+
11491160
test.beforeAll(async () => {
11501161
const auth = getGitHubAuth();
11511162
if (!auth) return;

0 commit comments

Comments
 (0)