From 472ca55b2dc530b3684c18b428531e902bff1ca0 Mon Sep 17 00:00:00 2001
From: Jure <juretriglav@gmail.com>
Date: Wed, 1 Nov 2017 07:14:09 -0400
Subject: [PATCH] Revert "Wrap Authorize children to avoid errors when there is
 more than a single element"

This reverts commit 3b578dbc9a59c251251263a802070ee2bdf4bb08
---
 src/helpers/Authorize.jsx       |  2 +-
 test/helpers/Authorize.test.jsx | 10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/helpers/Authorize.jsx b/src/helpers/Authorize.jsx
index d8415874d..3c6322812 100644
--- a/src/helpers/Authorize.jsx
+++ b/src/helpers/Authorize.jsx
@@ -41,7 +41,7 @@ export class Authorize extends React.Component {
 
   render() {
     return this.state.authorized
-      ? <div>{this.props.children}</div>
+      ? this.props.children
       : this.props.unauthorized || null
   }
 }
diff --git a/test/helpers/Authorize.test.jsx b/test/helpers/Authorize.test.jsx
index cb0c27f92..e02eacee8 100644
--- a/test/helpers/Authorize.test.jsx
+++ b/test/helpers/Authorize.test.jsx
@@ -8,8 +8,7 @@ global.PUBSWEET_COMPONENTS = []
 function makeWrapper(props = {}) {
   return shallow(
     <Authorize currentUser={{ id: 'user1' }} {...props}>
-      <span className="secret" />
-      <span className="sibling" />
+      <div />
     </Authorize>,
   )
 }
@@ -45,12 +44,11 @@ describe('<Authorize/>', () => {
   })
 
   it('optionally shows alternative content when not authorized', async () => {
-    const wrapper = makeWrapper({ authsome, unauthorized: <span className="message" /> })
+    const wrapper = makeWrapper({ authsome, unauthorized: <span /> })
 
     resolveMode(false)
     await modePromise
-    expect(wrapper.find('.secret')).toHaveLength(0)
-    expect(wrapper.find('.message')).toHaveLength(1)
+    expect(wrapper.type()).toBe('span')
   })
 
   it('is empty when authsome throws', async () => {
@@ -74,7 +72,7 @@ describe('<Authorize/>', () => {
 
     resolveMode(true)
     await modePromise
-    expect(wrapper.find('.secret')).toHaveLength(1)
+    expect(wrapper.type()).toBe('div')
   })
 
   it('rechecks auth when props change', () => {
-- 
GitLab