/* Copyright (C) 2018 Canonical Ltd. */
'use strict';

const React = require('react');

const EXPERTS = require('../expert-card/experts');
const ExpertCard = require('../expert-card/expert-card');
const ExpertStoreCard = require('../expert-store-card/expert-store-card');

const jsTestUtils = require('../../utils/component-test-utils');

describe('ExpertStoreCard', function() {
  function renderComponent(options={}) {
    return jsTestUtils.shallowRender(
      <ExpertStoreCard
        classes={options.classes || ['extra-class']}
        expert={options.expert || 'spicule'}
        staticURL="/media" />, true);
  }

  it('can render', () => {
    const renderer = renderComponent();
    const output = renderer.getRenderOutput();
    const expected = (
      <ExpertCard
        classes={['extra-class']}
        expert={EXPERTS['spicule']}
        staticURL="/media">
        <div className="expert-store-card">
          <p className="expert-store-card__description">
          Learn how Spicule and Canonical can help solve your Big Data
          challenges with JAAS:
          </p>
          <a className="button--inline-neutral"
            href="http://jujucharms.com/experts/"
            target="_blank">
            Learn about Big Data expertise&hellip;
          </a>
        </div>
      </ExpertCard>);
    expect(output).toEqualJSX(expected);
  });
});

@@ -84,118 +84,43 @@
 ');%0A
-%0A
 const 
-EXPERTS = require('../expert-card/experts');%0Aconst ExpertCard = require('../expert-card/expert-card
+enzyme = require('enzyme
 ');%0A
+%0A
 cons
@@ -195,74 +195,8 @@
 );%0A%0A
-const jsTestUtils = require('../../utils/component-test-utils');%0A%0A
 desc
@@ -236,18 +236,16 @@
 ) %7B%0A
+%0A
   
-function
+const
  ren
@@ -260,16 +260,19 @@
 nent
+ = 
 (options
 =%7B%7D)
@@ -271,55 +271,34 @@
 ions
-=
+ = 
 %7B%7D) 
-%7B%0A    return jsTestUtils.shallowRender(%0A  
+=%3E enzyme.shallow(%0A
     
@@ -312,34 +312,32 @@
 StoreCard%0A      
- 
- 
 classes=%7Boptions
@@ -363,34 +363,32 @@
 -class'%5D%7D%0A      
-  
 expert=%7Boptions.
@@ -406,34 +406,32 @@
 spicule'%7D%0A      
- 
- 
 staticURL=%22/medi
@@ -439,20 +439,13 @@
 %22 /%3E
-, true);%0A  %7D
+%0A  );
 %0A%0A  
@@ -479,22 +479,21 @@
   const 
-render
+wrapp
 er = ren
@@ -522,186 +522,21 @@
 nst 
-output = renderer.getRenderOutput();%0A    const expected = (%0A      %3CExpertCard%0A        classes=%7B%5B'extra-class'%5D%7D%0A        expert=%7BEXPERTS%5B'spicule'%5D%7D%0A        staticURL=%22/media%22%3E%0A  
+expected = (%0A
     
@@ -573,18 +573,16 @@
 -card%22%3E%0A
-  
         
@@ -632,26 +632,24 @@
 n%22%3E%0A        
-  
 Learn how Sp
@@ -705,18 +705,16 @@
         
- 
- 
 challeng
@@ -735,18 +735,16 @@
         
-  
 %3C/p%3E%0A   
@@ -748,18 +748,16 @@
         
- 
- 
 %3Ca class
@@ -786,18 +786,16 @@
 eutral%22%0A
-  
         
@@ -844,18 +844,16 @@
         
- 
- 
 target=%22
@@ -861,18 +861,16 @@
 blank%22%3E%0A
-  
         
@@ -922,17 +922,13 @@
     
-  
 %3C/a%3E%0A
-  
     
@@ -939,61 +939,69 @@
 div%3E
+);
 %0A    
-  %3C/ExpertCard%3E);%0A    expect(output).toEqualJSX(
+assert.compareJSX(wrapper.find('.expert-store-card'), 
 expe

Update expert store card tests to use enzyme.