Skip to content

Commit

Permalink
Merge branch 'master' into feature/rich-paste-filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaudcolas authored Mar 10, 2017
2 parents e2feca2 + 3641d6f commit 3e36fd5
Show file tree
Hide file tree
Showing 12 changed files with 228 additions and 103 deletions.
12 changes: 9 additions & 3 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ else
# Fail on first line that fails.
set -e

NEW_FILES=$(git --no-pager diff --name-only --cached)
NEW_FILES=$(git --no-pager diff --name-only --cached --diff-filter=d)
JS_FILES=$(echo "$NEW_FILES" | { grep .js$ || true; })
SNAPSHOT_FILES=$(echo "$NEW_FILES" | { grep .snap$ || true; })

if [ -n "$JS_FILES" ];
then
npm run linter:js -s -- $JS_FILES
npm run test -s;
exit 0
fi

if [ -n "$JS_FILES" ] || [ -n "$SNAPSHOT_FILES" ];
then
npm run test -s
fi

exit 0
fi
2 changes: 2 additions & 0 deletions lib/blocks/__snapshots__/DividerBlock.test.js.snap
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`DividerBlock basic 1`] = `<hr />`;
32 changes: 22 additions & 10 deletions lib/blocks/__snapshots__/EmbedBlock.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`EmbedBlock #isActive 1`] = `
<div>
<Icon
className="RichEditor-media-icon"
name="icon-media"
title={null} />
title={null}
/>
<div
className="RichEditor-media-container"
onClick={[Function]}>
onClick={[Function]}
>
<span
className="RichEditor-media-preview">
className="RichEditor-media-preview"
>
<img
alt="Test title"
src="http://www.example.com/example.png" />
src="http://www.example.com/example.png"
/>
</span>
</div>
<div
className="RichEditor-media-options">
className="RichEditor-media-options"
>
<h3>
<strong>
Test title
Expand All @@ -28,7 +35,8 @@ exports[`EmbedBlock #isActive 1`] = `
<a
href="http://www.example.com/"
rel="noopener noreferrer"
target="_blank">
target="_blank"
>
http://www.example.com/
</a>
</span>
Expand All @@ -54,15 +62,19 @@ exports[`EmbedBlock basic 1`] = `
<Icon
className="RichEditor-media-icon"
name="icon-media"
title={null} />
title={null}
/>
<div
className="RichEditor-media-container"
onClick={[Function]}>
onClick={[Function]}
>
<span
className="RichEditor-media-preview">
className="RichEditor-media-preview"
>
<img
alt="Test title"
src="http://www.example.com/example.png" />
src="http://www.example.com/example.png"
/>
</span>
</div>
</div>
Expand Down
134 changes: 90 additions & 44 deletions lib/blocks/__snapshots__/ImageBlock.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,40 +1,52 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ImageBlock #alignment 1`] = `
<div>
<Icon
className="RichEditor-media-icon"
name="icon-image"
title={null} />
title={null}
/>
<div
className="RichEditor-media-container"
onClick={[Function]}>
onClick={[Function]}
>
<span
className="RichEditor-media-preview">
className="RichEditor-media-preview"
>
<img
alt="Test alt"
src="http://www.example.com/example.png" />
src="http://www.example.com/example.png"
/>
</span>
</div>
<div
className="RichEditor-media-options">
className="RichEditor-media-options"
>
<div
className="RichEditor-grid">
className="RichEditor-grid"
>
<div
className="RichEditor-col">
className="RichEditor-col"
>
<label
className="u-block">
className="u-block"
>
<h4>
Alt text
</h4>
<p>
<input
onChange={[Function]}
type="text"
value="Test alt text" />
value="Test alt text"
/>
</p>
</label>
</div>
<div
className="RichEditor-col">
className="RichEditor-col"
>
<h4>
Image alignment
</h4>
Expand All @@ -44,15 +56,17 @@ exports[`ImageBlock #alignment 1`] = `
checked={true}
onChange={[Function]}
type="radio"
value="left" />
value="left"
/>
Left
</label>
<label>
<input
checked={false}
onChange={[Function]}
type="radio"
value="right" />
value="right"
/>
Right
</label>
</p>
Expand All @@ -62,13 +76,15 @@ exports[`ImageBlock #alignment 1`] = `
<button
className="button button-secondary"
onClick={[Function]}
type="button">
type="button"
>
Save changes
</button>
<button
className="button button-secondary no"
onClick={[Function]}
type="button">
type="button"
>
Cancel
</button>
</p>
Expand All @@ -81,38 +97,48 @@ exports[`ImageBlock #entityConfig.imageFormats 1`] = `
<Icon
className="RichEditor-media-icon"
name="icon-image"
title={null} />
title={null}
/>
<div
className="RichEditor-media-container"
onClick={[Function]}>
onClick={[Function]}
>
<span
className="RichEditor-media-preview">
className="RichEditor-media-preview"
>
<img
alt="Test alt"
src="http://www.example.com/example.png" />
src="http://www.example.com/example.png"
/>
</span>
</div>
<div
className="RichEditor-media-options">
className="RichEditor-media-options"
>
<div
className="RichEditor-grid">
className="RichEditor-grid"
>
<div
className="RichEditor-col">
className="RichEditor-col"
>
<label
className="u-block">
className="u-block"
>
<h4>
Alt text
</h4>
<p>
<input
onChange={[Function]}
type="text"
value="Test alt text" />
value="Test alt text"
/>
</p>
</label>
</div>
<div
className="RichEditor-col">
className="RichEditor-col"
>
<h4>
Image alignment
</h4>
Expand All @@ -122,15 +148,17 @@ exports[`ImageBlock #entityConfig.imageFormats 1`] = `
checked={false}
onChange={[Function]}
type="radio"
value="left" />
value="left"
/>
Left
</label>
<label>
<input
checked={true}
onChange={[Function]}
type="radio"
value="right" />
value="right"
/>
Right
</label>
</p>
Expand All @@ -140,13 +168,15 @@ exports[`ImageBlock #entityConfig.imageFormats 1`] = `
<button
className="button button-secondary"
onClick={[Function]}
type="button">
type="button"
>
Save changes
</button>
<button
className="button button-secondary no"
onClick={[Function]}
type="button">
type="button"
>
Cancel
</button>
</p>
Expand All @@ -159,38 +189,48 @@ exports[`ImageBlock #isActive 1`] = `
<Icon
className="RichEditor-media-icon"
name="icon-image"
title={null} />
title={null}
/>
<div
className="RichEditor-media-container"
onClick={[Function]}>
onClick={[Function]}
>
<span
className="RichEditor-media-preview">
className="RichEditor-media-preview"
>
<img
alt="Test alt"
src="http://www.example.com/example.png" />
src="http://www.example.com/example.png"
/>
</span>
</div>
<div
className="RichEditor-media-options">
className="RichEditor-media-options"
>
<div
className="RichEditor-grid">
className="RichEditor-grid"
>
<div
className="RichEditor-col">
className="RichEditor-col"
>
<label
className="u-block">
className="u-block"
>
<h4>
Alt text
</h4>
<p>
<input
onChange={[Function]}
type="text"
value="Test alt text" />
value="Test alt text"
/>
</p>
</label>
</div>
<div
className="RichEditor-col">
className="RichEditor-col"
>
<h4>
Image alignment
</h4>
Expand All @@ -201,13 +241,15 @@ exports[`ImageBlock #isActive 1`] = `
<button
className="button button-secondary"
onClick={[Function]}
type="button">
type="button"
>
Save changes
</button>
<button
className="button button-secondary no"
onClick={[Function]}
type="button">
type="button"
>
Cancel
</button>
</p>
Expand All @@ -220,15 +262,19 @@ exports[`ImageBlock basic 1`] = `
<Icon
className="RichEditor-media-icon"
name="icon-image"
title={null} />
title={null}
/>
<div
className="RichEditor-media-container"
onClick={[Function]}>
onClick={[Function]}
>
<span
className="RichEditor-media-preview">
className="RichEditor-media-preview"
>
<img
alt="Test alt"
src="http://www.example.com/example.png" />
src="http://www.example.com/example.png"
/>
</span>
</div>
</div>
Expand Down
Loading

0 comments on commit 3e36fd5

Please sign in to comment.