Skip to content

Commit

Permalink
Merge branch 'develop' into experimental/button/emotion
Browse files Browse the repository at this point in the history
  • Loading branch information
dratwas committed Feb 11, 2020
1 parent 5112c36 commit 57d436b
Show file tree
Hide file tree
Showing 295 changed files with 10,559 additions and 6,674 deletions.
33 changes: 18 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ commands:
- restore_cache:
name: Restore Yarn Cache
keys:
- yarn-i18n-v4-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}
- yarn-i18n-v4-cache-v{{ .Environment.CACHE_TRIGGER_VERSION }}-job-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}
- run:
name: Yarn Install
command: yarn install --frozen-lockfile --prefer-offline
command: yarn install --frozen-lockfile --prefer-offline --network-concurrency 1
- save_cache:
name: Save Yarn Cache
key: yarn-i18n-v4-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}
key: yarn-i18n-v4-cache-v{{ .Environment.CACHE_TRIGGER_VERSION }}-job-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}
paths:
- node_modules
- i18n-cache/data
Expand Down Expand Up @@ -112,34 +112,37 @@ jobs:
- restore_cache:
name: Restore Dependencies Cache
keys:
- dependencies-v2-{{ checksum "react-native-aztec/ios/Cartfile.resolved" }}-{{
- dependencies-v3-{{ checksum "ios/Gemfile.lock" }}-{{ checksum "ios/Podfile.lock" }}-{{
checksum "yarn.lock" }}
- dependencies-v2-{{ checksum "react-native-aztec/ios/Cartfile.resolved" }}
- dependencies-v2-
- dependencies-v3-{{ checksum "ios/Gemfile.lock" }}-{{ checksum "ios/Podfile.lock" }}
- dependencies-v3-{{ checksum "ios/Gemfile.lock" }}
- dependencies-v3-
- run:
name: Yarn preios (if needed)
command: test -e ios/build/gutenberg/Build/Products/Release-iphonesimulator/gutenberg.app || yarn preios
command: test -e ios/build/gutenberg/Build/Products/Release-iphonesimulator/GutenbergDemo.app || yarn preios
- save_cache:
name: Save Dependencies Cache
key: dependencies-v2-{{ checksum "react-native-aztec/ios/Cartfile.resolved" }}-{{
key: dependencies-v3-{{ checksum "ios/Gemfile.lock" }}-{{ checksum "ios/Podfile.lock" }}-{{
checksum "yarn.lock" }}
paths:
- react-native-aztec/ios/Carthage
- ~/.rncache
- ios/Pods
- ~/Library/Caches/CocoaPods
- ~/.cocoapods/repos/trunk
- ios/vendor
- run:
name: Build (if needed)
command: test -e ios/build/gutenberg/Build/Products/Release-iphonesimulator/gutenberg.app || yarn react-native run-ios --configuration Release --no-packager
command: test -e ios/build/gutenberg/Build/Products/Release-iphonesimulator/GutenbergDemo.app || yarn react-native run-ios --configuration Release --no-packager
- run:
name: Bundle iOS
command: yarn test:e2e:bundle:ios
- run:
name: Generate .app file for testing
command: WORK_DIR=$(pwd) && cd ./ios/build/gutenberg/Build/Products/Release-iphonesimulator && zip -r $WORK_DIR/ios/Gutenberg.app.zip gutenberg.app
command: WORK_DIR=$(pwd) && cd ./ios/build/gutenberg/Build/Products/Release-iphonesimulator && zip -r $WORK_DIR/ios/GutenbergDemo.app.zip GutenbergDemo.app
- run:
name: Upload .app to sauce labs
command: |
source bin/sauce-pre-upload.sh
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/automattic/Gutenberg-$SAUCE_FILENAME.app.zip?overwrite=true --data-binary @./ios/Gutenberg.app.zip
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/automattic/Gutenberg-$SAUCE_FILENAME.app.zip?overwrite=true --data-binary @./ios/GutenbergDemo.app.zip
- run:
name: Run Device Tests
command: |
Expand All @@ -150,12 +153,12 @@ jobs:
path: ./reports/test-results
- run:
name: Prepare build cache
command: rm ios/build/gutenberg/Build/Products/Release-iphonesimulator/gutenberg.app/main.jsbundle
command: rm ios/build/gutenberg/Build/Products/Release-iphonesimulator/GutenbergDemo.app/main.jsbundle
- save_cache:
name: Save Build Cache
key: ios-build-cache-{{ checksum "ios-checksums.txt" }}
paths:
- ios/build/gutenberg/Build/Products/Release-iphonesimulator/gutenberg.app
- ios/build/gutenberg/Build/Products/Release-iphonesimulator/GutenbergDemo.app

workflows:
gutenberg-mobile:
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
},
react: {
pragma: "React",
version: "16.8.3",
version: "detect",
flowVersion: "0.92.0",
},
},
Expand Down
4 changes: 1 addition & 3 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

; Ignore various node_modules
<PROJECT_ROOT>/node_modules/react-native-gesture-handler/.*
<PROJECT_ROOT>/node_modules/react-native-linear-gradient/.*
<PROJECT_ROOT>/node_modules/expo/.*
<PROJECT_ROOT>/node_modules/react-navigation/.*
<PROJECT_ROOT>/node_modules/xdl/.*
Expand All @@ -43,9 +44,6 @@
<PROJECT_ROOT>/node_modules/jest-enzyme/.*
<PROJECT_ROOT>/node_modules/enzyme-matchers/.*

; Ignore react-native-recyclerview-list example app
<PROJECT_ROOT>/node_modules/react-native-recyclerview-list/example

; Ignore immutable-js. See https://github.com/facebook/immutable-js/issues/1308
<PROJECT_ROOT>/node_modules/immutable/.*

Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,8 @@ bin/wp-cli.phar

# Report generated from jest-junit
/junit.xml

# Cocoapods

ios/Pods
ios/vendor
2 changes: 1 addition & 1 deletion Gutenberg.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Pod::Spec.new do |s|
s.swift_version = '5.0'

s.dependency 'React', react_native_version
s.dependency 'React-CoreModules', react_native_version
s.dependency 'React-RCTImage', react_native_version

s.dependency 'WordPress-Aztec-iOS'
s.dependency 'RNTAztecView'
end
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Then, open `chrome://inspect` in Chrome to attach the debugger (look into the "R

## Writing and Running Unit Tests

This project is set up to use [jest](https://facebook.github.io/jest/) for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called `__tests__` or with the `.test.js` extension to have the files loaded by jest. See an example test [here](https://github.com/wordpress-mobile/gutenberg-mobile/blob/develop/src/app/App.test.js). The [jest documentation](https://facebook.github.io/jest/docs/en/getting-started.html) is also a wonderful resource, as is the [React Native testing tutorial](https://facebook.github.io/jest/docs/en/tutorial-react-native.html).
This project is set up to use [jest](https://facebook.github.io/jest/) for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called `__tests__` or with the `.test.js` extension to have the files loaded by jest. See an example test [here](https://github.com/wordpress-mobile/gutenberg-mobile/blob/develop/src/index.test.js). The [jest documentation](https://facebook.github.io/jest/docs/en/getting-started.html) is also a wonderful resource, as is the [React Native testing tutorial](https://facebook.github.io/jest/docs/en/tutorial-react-native.html).

## UI Tests

Expand Down
29 changes: 28 additions & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
1.23.0
------
* New block: Group

1.22.0
------
* Add support for changing images size in Gallery block
* Make inserter to show options on long-press to add before/after
* Retry displaying image when connectivity restores
* [iOS] Show an "Edit" button overlay on selected image blocks
* [Android] Fix blank post when sharing media from another app
* Add support for image size options in the gallery block
* Fix issue that sometimes prevented merging paragraph blocks

1.21.0
------
* Reduced padding around text on Rich Text based blocks.
* [Android] Improved stability on very long posts.

1.20.0
------
* Fix bug where image placeholders would sometimes not be shown
* Fix crash on undo
* Style fixes on the navigation UI
* [iOS] Fix focus issue
* New block: Shortcode. You can now create and edit Shortcode blocks in the editor.

1.19.0
------
* Add support for changing Settings in List Block.
* [iOS] Fix crash dismissing bottom-sheet after device rotation.
* [Android] Add support for Preformatted block.
* New block: Gallery. You can now create image galleries using WordPress Media library. Upload feature is coming soon.
* Add support for Video block settings

1.18.0
------
* Add support for Video block settings
* [iOS] Added native fullscreen preview when clicking image from Image Block
* New block: Spacer

Expand Down
2 changes: 1 addition & 1 deletion RNTAztecView.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ Pod::Spec.new do |s|
s.xcconfig = {'OTHER_LDFLAGS' => '-lxml2',
'HEADER_SEARCH_PATHS' => '/usr/include/libxml2'}
s.dependency 'React-Core'
s.dependency 'WordPress-Aztec-iOS'
s.dependency 'WordPress-Aztec-iOS', '1.15.0'

end
56 changes: 56 additions & 0 deletions __device-tests__/gutenberg-editor-gallery.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
* @format
* */

/**
* Internal dependencies
*/
import EditorPage from './pages/editor-page';
import {
setupDriver,
isLocalEnvironment,
stopDriver,
} from './helpers/utils';

jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000000;

describe( 'Gutenberg Editor Gallery Block tests', () => {
let driver;
let editorPage;
let allPassed = true;

// Use reporter for setting status for saucelabs Job
if ( ! isLocalEnvironment() ) {
const reporter = {
specDone: async ( result ) => {
allPassed = allPassed && result.status !== 'failed';
},
};

jasmine.getEnv().addReporter( reporter );
}

beforeAll( async () => {
driver = await setupDriver();
editorPage = new EditorPage( driver );
} );

it( 'should be able to see visual editor', async () => {
await expect( editorPage.getBlockList() ).resolves.toBe( true );
} );

it( 'should be able to add a gallery block', async () => {
await editorPage.addNewGalleryBlock();
const galleryBlock = await editorPage.getGalleryBlockAtPosition( 1 );

expect( galleryBlock ).toBeTruthy();
await editorPage.removeGalleryBlockAtPosition( 1 );
} );

afterAll( async () => {
if ( ! isLocalEnvironment() ) {
driver.sauceJobStatus( allPassed );
}
await stopDriver( driver );
} );
} );
13 changes: 13 additions & 0 deletions __device-tests__/gutenberg-editor-lists.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ describe( 'Gutenberg Editor tests for List block', () => {
await editorPage.verifyHtmlContent( testData.listHtml );
} );

it( 'should update format to ordered list, using toolbar button', async () => {
const listBlockElement = await editorPage.getListBlockAtPosition( 1 );

// Click List block to force EditText focus
await listBlockElement.click();

// Send a click on the order list format button
await editorPage.clickOrderedListToolBarButton();

// switch to html and verify html
await editorPage.verifyHtmlContent( testData.listHtmlOrdered );
} );

afterAll( async () => {
if ( ! isLocalEnvironment() ) {
driver.sauceJobStatus( allPassed );
Expand Down
4 changes: 3 additions & 1 deletion __device-tests__/gutenberg-editor-paragraph.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
clickBeginningOfElement,
stopDriver,
isAndroid,
swipeUp,
} from './helpers/utils';
import testData from './helpers/test-data';

Expand Down Expand Up @@ -62,7 +63,7 @@ describe( 'Gutenberg Editor tests for Paragraph Block', () => {
await editorPage.sendTextToParagraphBlock( paragraphBlockElement, testData.shortText );
const textViewElement = await editorPage.getTextViewForParagraphBlock( paragraphBlockElement );
await clickMiddleOfElement( driver, textViewElement );
await editorPage.sendTextToParagraphBlock( paragraphBlockElement, '\n' );
await editorPage.sendTextToParagraphBlock( paragraphBlockElement, '\n', false );
expect( await editorPage.hasParagraphBlockAtPosition( 1 ) && await editorPage.hasParagraphBlockAtPosition( 2 ) )
.toBe( true );

Expand Down Expand Up @@ -115,6 +116,7 @@ describe( 'Gutenberg Editor tests for Paragraph Block', () => {
await editorPage.sendTextToParagraphBlockAtPosition( 1, testData.longText );

for ( let i = 3; i > 0; i-- ) {
await swipeUp( driver );
await editorPage.removeParagraphBlockAtPosition( i );
}
} );
Expand Down
3 changes: 3 additions & 0 deletions __device-tests__/helpers/test-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ exports.listItem2 = `Honey`;
exports.listHtml = `<!-- wp:list -->
<ul><li>Milk</li><li>Honey</li></ul>
<!-- /wp:list -->`;
exports.listHtmlOrdered = `<!-- wp:list {"ordered":true} -->
<ol><li>Milk</li><li>Honey</li></ol>
<!-- /wp:list -->`;
exports.listEndedHtml = `<!-- wp:list -->
<ul><li>Milk</li></ul>
<!-- /wp:list -->
Expand Down
Loading

0 comments on commit 57d436b

Please sign in to comment.