Skip to content

Commit

Permalink
Merge branch 'develop' into issue/autoscroll-on-list-block
Browse files Browse the repository at this point in the history
  • Loading branch information
etoledom committed Apr 19, 2019
2 parents c6ca773 + 0be0fa2 commit abc09d1
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 5 deletions.
20 changes: 20 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ commands:
- run:
name: Checkout Gutenberg
command: git submodule update --init --recursive
add-jest-reporter-dir:
steps:
- run:
name: Create reports directory
command: mkdir reports && mkdir reports/test-results

jobs:
checks:
Expand All @@ -39,6 +44,7 @@ jobs:
- checkout
- checkout-gutenberg
- yarn-install
- add-jest-reporter-dir
- run:
name: Set Environment Variables
command: |
Expand All @@ -48,6 +54,10 @@ jobs:
- run:
name: Run Checks
command: bin/ci-checks-js.sh
environment:
JEST_JUNIT_OUTPUT: "reports/test-results/android-test-results.xml"
- store_test_results:
path: ./reports/test-results
android-device-checks:
docker:
- image: circleci/android:api-28-node8-alpha
Expand All @@ -57,6 +67,7 @@ jobs:
name: Checkout Gutenberg
command: git submodule update --init --recursive
- yarn-install
- add-jest-reporter-dir
- run:
name: Set Environment Variables
command: |
Expand All @@ -72,13 +83,18 @@ jobs:
- run:
name: Run Device Tests
command: yarn device-tests
environment:
JEST_JUNIT_OUTPUT: "reports/test-results/android-test-results.xml"
- store_test_results:
path: ./reports/test-results
ios-device-checks:
macos:
xcode: "10.2.0"
steps:
- checkout
- checkout-gutenberg
- yarn-install
- add-jest-reporter-dir
- run:
name: Set Environment Variables
command: |
Expand Down Expand Up @@ -112,6 +128,10 @@ jobs:
name: Run Device Tests
command: |
yarn device-tests
environment:
JEST_JUNIT_OUTPUT: "reports/test-results/ios-test-results.xml"
- store_test_results:
path: ./reports/test-results

workflows:
gutenberg-mobile:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,6 @@ buck-out/
appium-out.log

bin/wp-cli.phar

# Report generated from jest-junit
/junit.xml
11 changes: 11 additions & 0 deletions __device-tests__/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
import childProcess from 'child_process';
import wd from 'wd';
import crypto from 'crypto';

/**
* Internal dependencies
Expand Down Expand Up @@ -108,6 +109,16 @@ const setupDriver = async () => {
};

const stopDriver = async ( driver: wd.PromiseChainWebdriver ) => {
if ( ! isLocalEnvironment() ) {
const jobID = driver.sessionID;

const hash = crypto.createHmac( 'md5', jobID )
.update( serverConfigs.sauce.auth )
.digest( 'hex' );
const jobURL = `https://saucelabs.com/jobs/${ jobID }?auth=${ hash }.`;
// eslint-disable-next-line no-console
console.log( `You can view the video of this test run at ${ jobURL }` );
}
if ( driver === undefined ) {
return;
}
Expand Down
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ module.exports = {
snapshotSerializers: [
'enzyme-to-json/serializer',
],
reporters: [ 'default', 'jest-junit' ],
};
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@wordpress/eslint-plugin": "^2.0.0",
"@wordpress/jest-preset-default": "^4.0.0",
"appium": "^1.12.1",
"jest-junit": "^6.3.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^8.2.2",
"babel-jest": "^24.1.0",
Expand Down Expand Up @@ -76,12 +77,13 @@
"wpandroid": "yarn android --root $TMPDIR/gbmobile-wpandroidfakernroot --variant wasabiDebug --appIdSuffix beta --appFolder WordPress --main-activity=ui.WPLaunchActivity",
"preios": "yarn preios:xcode10 && yarn preios:carthage",
"preios:carthage": "cd react-native-aztec && yarn install-aztec-ios",
"preios:carthage:update": "cd react-native-aztec && yarn update-aztec-ios",
"preios:xcode10": "cd node_modules/react-native && ./scripts/ios-install-third-party.sh && cd third-party/glog-0.3.5 && [ -f libglog.pc ] || ../../scripts/ios-configure-glog.sh",
"ios": "react-native run-ios",
"test": "cross-env NODE_ENV=test jest --verbose --config jest.config.js",
"test:inside-gb": "cross-env NODE_ENV=test jest --verbose --config jest_gb.config.js",
"test:debug": "cross-env NODE_ENV=test node --inspect-brk jest --runInBand --verbose --config jest.config.js",
"device-tests": "cross-env NODE_ENV=test jest --detectOpenHandles --verbose --config jest_ui.config.js",
"device-tests": "cross-env NODE_ENV=test jest --runInBand --reporters=default --reporters=jest-junit --detectOpenHandles --verbose --config jest_ui.config.js",
"test:e2e": "yarn test:e2e:android && yarn test:e2e:ios",
"test:e2e:android": "TEST_RN_PLATFORM=android yarn device-tests",
"test:e2e:ios": "TEST_RN_PLATFORM=ios yarn device-tests",
Expand Down Expand Up @@ -157,4 +159,4 @@
"resolutions": {
"@react-native-community/cli": "^1.5.2"
}
}
}
2 changes: 1 addition & 1 deletion react-native-aztec/ios/Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "wordpress-mobile/AztecEditor-iOS" ~> 1.6.0-beta.1
github "wordpress-mobile/AztecEditor-iOS" "26164fb0f24027ecacc7105201e6e8a4332c7906"
2 changes: 1 addition & 1 deletion react-native-aztec/ios/Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "wordpress-mobile/AztecEditor-iOS" "1.6.0-beta.1"
github "wordpress-mobile/AztecEditor-iOS" "26164fb0f24027ecacc7105201e6e8a4332c7906"
11 changes: 10 additions & 1 deletion react-native-aztec/ios/RNTAztecView/RCTAztecView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ class RCTAztecView: Aztec.TextView {
// MARK: - Custom Edit Intercepts

private func interceptEnter(_ text: String) -> Bool {
if text == "\t" {
return true
}

guard text == "\n",
let onEnter = onEnter else {
return false
Expand All @@ -285,7 +289,12 @@ class RCTAztecView: Aztec.TextView {
onBackspace(caretData)
return true
}


override var keyCommands: [UIKeyCommand]? {
// Remove defautls Tab and Shift+Tab commands, leaving just Shift+Enter command.
return [carriageReturnKeyCommand]
}

// MARK: - Native-to-RN Value Packing Logic

func packForRN(_ text: String, withName name: String) -> [AnyHashable: Any] {
Expand Down
50 changes: 50 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,14 @@
"@types/istanbul-lib-coverage" "^1.1.0"
"@types/yargs" "^12.0.9"

"@jest/types@^24.7.0":
version "24.7.0"
resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.7.0.tgz#c4ec8d1828cdf23234d9b4ee31f5482a3f04f48b"
integrity sha512-ipJUa2rFWiKoBqMKP63Myb6h9+iT3FHRTF2M8OR6irxWzItisa8i4dcSg14IbvmXUnBlHBlUQPYUHWyX3UPpYA==
dependencies:
"@types/istanbul-lib-coverage" "^2.0.0"
"@types/yargs" "^12.0.9"

"@jimp/bmp@^0.5.4":
version "0.5.4"
resolved "https://registry.yarnpkg.com/@jimp/bmp/-/bmp-0.5.4.tgz#b7b375aa774f26154912569864d5466e71333ef1"
Expand Down Expand Up @@ -1650,6 +1658,11 @@
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz#2cc2ca41051498382b43157c8227fea60363f94a"
integrity sha512-ohkhb9LehJy+PA40rDtGAji61NCgdtKLAlFoYp4cnuuQEswwdK3vz9SOIkkyc3wrk8dzjphQApNs56yyXLStaQ==

"@types/istanbul-lib-coverage@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.0.tgz#1eb8c033e98cf4e1a4cedcaf8bcafe8cb7591e85"
integrity sha512-eAtOAFZefEnfJiRFQBGw1eYqa5GTLCZ1y86N0XSI/D6EB+E8z6VPV/UL7Gi5UEclFqoQk+6NRqEDsfmDLXn8sg==

"@types/node@*":
version "11.11.3"
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.3.tgz#7c6b0f8eaf16ae530795de2ad1b85d34bf2f5c58"
Expand Down Expand Up @@ -6773,6 +6786,16 @@ jest-jasmine2@^24.5.0:
pretty-format "^24.5.0"
throat "^4.0.0"

jest-junit@^6.3.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-6.3.0.tgz#99e64ebc54eddcb21238f0cc49f5820c89a8c785"
integrity sha512-3PH9UkpaomX6CUzqjlnk0m4yBCW/eroxV6v61OM6LkCQFO848P3YUhfIzu8ypZSBKB3vvCbB4WaLTKT0BrIf8A==
dependencies:
jest-validate "^24.0.0"
mkdirp "^0.5.1"
strip-ansi "^4.0.0"
xml "^1.0.1"

jest-leak-detector@^24.5.0:
version "24.5.0"
resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.5.0.tgz#21ae2b3b0da252c1171cd494f75696d65fb6fa89"
Expand Down Expand Up @@ -6959,6 +6982,18 @@ jest-validate@21.1.0:
leven "^2.1.0"
pretty-format "^21.1.0"

jest-validate@^24.0.0:
version "24.7.0"
resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.7.0.tgz#70007076f338528ee1b1c8a8258b1b0bb982508d"
integrity sha512-cgai/gts9B2chz1rqVdmLhzYxQbgQurh1PEQSvSgPZ8KGa1AqXsqC45W5wKEwzxKrWqypuQrQxnF4+G9VejJJA==
dependencies:
"@jest/types" "^24.7.0"
camelcase "^5.0.0"
chalk "^2.0.1"
jest-get-type "^24.3.0"
leven "^2.1.0"
pretty-format "^24.7.0"

jest-validate@^24.5.0:
version "24.5.0"
resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.5.0.tgz#62fd93d81214c070bb2d7a55f329a79d8057c7de"
Expand Down Expand Up @@ -9590,6 +9625,16 @@ pretty-format@^24.5.0:
ansi-styles "^3.2.0"
react-is "^16.8.4"

pretty-format@^24.7.0:
version "24.7.0"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.7.0.tgz#d23106bc2edcd776079c2daa5da02bcb12ed0c10"
integrity sha512-apen5cjf/U4dj7tHetpC7UEFCvtAgnNZnBDkfPv3fokzIqyOJckAG9OlAPC1BlFALnqT/lGB2tl9EJjlK6eCsA==
dependencies:
"@jest/types" "^24.7.0"
ansi-regex "^4.0.0"
ansi-styles "^3.2.0"
react-is "^16.8.4"

private@^0.1.6, private@~0.1.5:
version "0.1.8"
resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff"
Expand Down Expand Up @@ -12355,6 +12400,11 @@ xml2js@^0.4.17, xml2js@^0.4.5:
sax ">=0.6.0"
xmlbuilder "~9.0.1"

xml@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=

xmlbuilder@^9.0.1, xmlbuilder@^9.0.7, xmlbuilder@~9.0.1:
version "9.0.7"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d"
Expand Down

0 comments on commit abc09d1

Please sign in to comment.