Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
340
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
27
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TransFem.org
Sharkey
Commits
48a7679b
Unverified
Commit
48a7679b
authored
11 months ago
by
anatawa12
Committed by
GitHub
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
test: do not use indexedDB in cypress environment due to chrome bug (#13709)
parent
5c7c44c9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
5 merge requests
!556
release 2024.5.0
,
!554
prepare for 2024.5, 2nd try
,
!552
prepare for release 2024.5
,
!516
merge from misskey: preparing for release 2024.5.0
,
!502
merge from misskey at end of April
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cypress/support/commands.ts
+4
-0
4 additions, 0 deletions
cypress/support/commands.ts
packages/frontend/src/scripts/idb-proxy.ts
+10
-0
10 additions, 0 deletions
packages/frontend/src/scripts/idb-proxy.ts
with
14 additions
and
0 deletions
cypress/support/commands.ts
+
4
−
0
View file @
48a7679b
...
...
@@ -30,9 +30,13 @@ Cypress.Commands.add('visitHome', () => {
})
Cypress
.
Commands
.
add
(
'
resetState
'
,
()
=>
{
// iframe.contentWindow.indexedDB.deleteDatabase() がchromeのバグで使用できないため、indexedDBを無効化している。
// see https://github.com/misskey-dev/misskey/issues/13605#issuecomment-2053652123
/*
cy.window().then(win => {
win.indexedDB.deleteDatabase('keyval-store');
});
*/
cy
.
request
(
'
POST
'
,
'
/api/reset-db
'
,
{}).
as
(
'
reset
'
);
cy
.
get
(
'
@reset
'
).
its
(
'
status
'
).
should
(
'
equal
'
,
204
);
cy
.
reload
(
true
);
...
...
This diff is collapsed.
Click to expand it.
packages/frontend/src/scripts/idb-proxy.ts
+
10
−
0
View file @
48a7679b
...
...
@@ -15,6 +15,16 @@ const fallbackName = (key: string) => `idbfallback::${key}`;
let
idbAvailable
=
typeof
window
!==
'
undefined
'
?
!!
(
window
.
indexedDB
&&
window
.
indexedDB
.
open
)
:
true
;
// iframe.contentWindow.indexedDB.deleteDatabase() がchromeのバグで使用できないため、indexedDBを無効化している。
// バグが治って再度有効化するのであれば、cypressのコマンド内のコメントアウトを外すこと
// see https://github.com/misskey-dev/misskey/issues/13605#issuecomment-2053652123
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
if
(
window
.
Cypress
)
{
idbAvailable
=
false
;
console
.
log
(
'
Cypress detected. It will use localStorage.
'
);
}
if
(
idbAvailable
)
{
await
iset
(
'
idb-test
'
,
'
test
'
)
.
catch
(
err
=>
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment