Skip to content

Commit

Permalink
Merge pull request #5735 from wordpress-mobile/videopress-upload-tests
Browse files Browse the repository at this point in the history
Add upload test cases for VideoPress block
  • Loading branch information
fluiddot authored May 10, 2023
2 parents c3cfef6 + 2106632 commit c902cf1
Show file tree
Hide file tree
Showing 4 changed files with 667 additions and 1 deletion.
2 changes: 1 addition & 1 deletion jetpack
Submodule jetpack updated 765 files
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"prewpandroid": "rm -Rf $TMPDIR/gbmobile-wpandroidfakernroot && mkdir $TMPDIR/gbmobile-wpandroidfakernroot && ln -s $(cd \"$(dirname \"../../../\")\"; pwd) $TMPDIR/gbmobile-wpandroidfakernroot/android",
"wpandroid": "cd gutenberg && react-native run-android --root $TMPDIR/gbmobile-wpandroidfakernroot --variant wasabiDebug --appIdSuffix beta --appFolder WordPress --main-activity=ui.WPLaunchActivity",
"test": "cross-env NODE_ENV=test jest --verbose --config ./jest.config.js",
"test:update": "cross-env NODE_ENV=test jest --verbose --config ./jest.config.js --updateSnapshot",
"test:debug": "cross-env NODE_ENV=test node --inspect-brk node_modules/.bin/jest --runInBand --verbose --config jest.config.js",
"device-tests": "cross-env NODE_ENV=test jest --maxWorkers=2 --testPathIgnorePatterns='canary|gutenberg-editor-rendering' --verbose --config jest_ui.config.js",
"device-tests-canary": "cross-env NODE_ENV=test jest --maxWorkers=2 --testPathPattern=@canary --verbose --config jest_ui.config.js",
Expand Down
19 changes: 19 additions & 0 deletions src/test/videopress/__snapshots__/upload.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`VideoPress block - Uploads adds video by inserting URL: video ready 1`] = `"<!-- wp:videopress/video {"title":"video-title","description":"video-description","id":1,"guid":"AbCdEfGh","privacySetting":2,"allowDownload":false,"rating":"G","isPrivate":false,"duration":1200} /-->"`;

exports[`VideoPress block - Uploads cancel upload 1`] = `"<!-- wp:videopress/video /-->"`;

exports[`VideoPress block - Uploads finishes pending uploads upon opening the editor 1`] = `"<!-- wp:videopress/video {"title":"video-title","description":"video-description","id":1,"guid":"AbCdEfGh","privacySetting":2,"allowDownload":false,"rating":"G","isPrivate":false,"duration":1200} /-->"`;

exports[`VideoPress block - Uploads handles upload failure 1`] = `"<!-- wp:videopress/video {"id":1,"src":"file:///local-video-1.mp4"} /-->"`;

exports[`VideoPress block - Uploads takes a video and uploads it: loading state 1`] = `"<!-- wp:videopress/video {"id":3,"src":"file:///local-video-3.mp4"} /-->"`;

exports[`VideoPress block - Uploads takes a video and uploads it: video ready 1`] = `"<!-- wp:videopress/video {"title":"video-title","description":"video-description","id":1,"guid":"AbCdEfGh","privacySetting":2,"allowDownload":false,"rating":"G","isPrivate":false,"duration":1200} /-->"`;

exports[`VideoPress block - Uploads uploads a video from device: loading state 1`] = `"<!-- wp:videopress/video {"id":1,"src":"file:///local-video-1.mp4"} /-->"`;

exports[`VideoPress block - Uploads uploads a video from device: video ready 1`] = `"<!-- wp:videopress/video {"title":"video-title","description":"video-description","id":1,"guid":"AbCdEfGh","privacySetting":2,"allowDownload":false,"rating":"G","isPrivate":false,"duration":1200} /-->"`;

exports[`VideoPress block - Uploads uploads a video from media library: video ready 1`] = `"<!-- wp:videopress/video {"title":"video-title","description":"video-description","id":1,"guid":"AbCdEfGh","privacySetting":2,"allowDownload":false,"rating":"G","isPrivate":false,"duration":1200} /-->"`;
Loading

0 comments on commit c902cf1

Please sign in to comment.