Skip to content

Commit

Permalink
test(mixed): remove useless content tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Fedyashov committed Oct 2, 2017
1 parent 8ccf696 commit 11fef64
Show file tree
Hide file tree
Showing 17 changed files with 5 additions and 214 deletions.
13 changes: 0 additions & 13 deletions test/specs/views/Card/CardHeader-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import faker from 'faker'
import _ from 'lodash'
import React from 'react'

import { SUI } from 'src/lib'
import CardHeader from 'src/views/Card/CardHeader'
Expand All @@ -11,15 +9,4 @@ describe('CardHeader', () => {
common.rendersChildren(CardHeader)

common.implementsTextAlignProp(CardHeader, _.without(SUI.TEXT_ALIGNMENTS, 'justified'))

describe('description prop', () => {
it('renders child text', () => {
const text = faker.hacker.phrase()

shallow(<CardHeader content={text} />)
.children()
.at(0)
.should.contain.text(text)
})
})
})
13 changes: 0 additions & 13 deletions test/specs/views/Card/CardMeta-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import faker from 'faker'
import _ from 'lodash'
import React from 'react'

import { SUI } from 'src/lib'
import CardMeta from 'src/views/Card/CardMeta'
Expand All @@ -11,15 +9,4 @@ describe('CardMeta', () => {
common.rendersChildren(CardMeta)

common.implementsTextAlignProp(CardMeta, _.without(SUI.TEXT_ALIGNMENTS, 'justified'))

describe('description prop', () => {
it('renders child text', () => {
const text = faker.hacker.phrase()

shallow(<CardMeta content={text} />)
.children()
.at(0)
.should.contain.text(text)
})
})
})
9 changes: 0 additions & 9 deletions test/specs/views/Feed/FeedContent-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

import FeedContent from 'src/views/Feed/FeedContent'
import FeedDate from 'src/views/Feed/FeedDate'
import FeedSummary from 'src/views/Feed/FeedSummary'
Expand Down Expand Up @@ -36,11 +34,4 @@ describe('FeedContent', () => {
ShorthandComponent: FeedMeta,
mapValueToProps: val => ({ content: val }),
})

it('renders text with content prop', () => {
shallow(<FeedContent content='foo' />)
.children()
.at(0)
.should.contain.text('foo')
})
})
12 changes: 0 additions & 12 deletions test/specs/views/Feed/FeedDate-test.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
import faker from 'faker'
import React from 'react'

import FeedDate from 'src/views/Feed/FeedDate'
import * as common from 'test/specs/commonTests'

describe('FeedDate', () => {
common.isConformant(FeedDate)
common.rendersChildren(FeedDate)

it('renders text with date prop', () => {
const text = faker.hacker.phrase()

shallow(<FeedDate content={text} />)
.children()
.at(0)
.should.contain.text(text)
})
})
15 changes: 5 additions & 10 deletions test/specs/views/Feed/FeedExtra-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,10 @@ describe('FeedExtra', () => {
common.propKeyOnlyToClassName(FeedExtra, 'images')
common.propKeyOnlyToClassName(FeedExtra, 'text')

it('renders text with content prop', () => {
shallow(<FeedExtra content='foo' />)
.children()
.at(0)
.should.contain.text('foo')
})

it('renders <img> with images prop', () => {
shallow(<FeedExtra images={['a', 'b', 'c']} />)
.should.have.exactly(3).descendants('img')
describe('images', () => {
it('renders images elements', () => {
shallow(<FeedExtra images={['a', 'b', 'c']} />)
.should.have.exactly(3).descendants('img')
})
})
})
9 changes: 0 additions & 9 deletions test/specs/views/Feed/FeedLike-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

import FeedLike from 'src/views/Feed/FeedLike'
import * as common from 'test/specs/commonTests'

Expand All @@ -8,11 +6,4 @@ describe('FeedLike', () => {
common.rendersChildren(FeedLike)

common.implementsIconProp(FeedLike)

it('renders text with content prop', () => {
shallow(<FeedLike content='foo' />)
.children()
.at(0)
.should.contain.text('foo')
})
})
9 changes: 0 additions & 9 deletions test/specs/views/Feed/FeedMeta-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

import FeedMeta from 'src/views/Feed/FeedMeta'
import FeedLike from 'src/views/Feed/FeedLike'
import * as common from 'test/specs/commonTests'
Expand All @@ -13,11 +11,4 @@ describe('FeedMeta', () => {
ShorthandComponent: FeedLike,
mapValueToProps: val => ({ content: val }),
})

it('renders text with meta prop', () => {
shallow(<FeedMeta content='foo' />)
.children()
.at(0)
.should.contain.text('foo')
})
})
9 changes: 0 additions & 9 deletions test/specs/views/Feed/FeedSummary-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

import FeedSummary from 'src/views/Feed/FeedSummary'
import FeedDate from 'src/views/Feed/FeedDate'
import FeedUser from 'src/views/Feed/FeedUser'
Expand All @@ -19,11 +17,4 @@ describe('FeedSummary', () => {
ShorthandComponent: FeedUser,
mapValueToProps: val => ({ content: val }),
})

it('renders text with content prop', () => {
shallow(<FeedSummary content='foo' />)
.children()
.at(0)
.should.contain.text('foo')
})
})
12 changes: 0 additions & 12 deletions test/specs/views/Feed/FeedUser-test.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
import faker from 'faker'
import React from 'react'

import FeedUser from 'src/views/Feed/FeedUser'
import * as common from 'test/specs/commonTests'

describe('FeedUser', () => {
common.isConformant(FeedUser)
common.rendersChildren(FeedUser)

it('renders text with user prop', () => {
const text = faker.hacker.phrase()

shallow(<FeedUser content={text} />)
.children()
.at(0)
.should.contain.text(text)
})
})
14 changes: 0 additions & 14 deletions test/specs/views/Item/ItemContent-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import faker from 'faker'
import React from 'react'

import ItemContent from 'src/views/Item/ItemContent'
import ItemDescription from 'src/views/Item/ItemDescription'
import ItemExtra from 'src/views/Item/ItemExtra'
Expand Down Expand Up @@ -33,15 +30,4 @@ describe('ItemContent', () => {
mapValueToProps: val => ({ content: val }),
})
common.implementsVerticalAlignProp(ItemContent)

describe('content prop', () => {
it('renders text', () => {
const text = faker.hacker.phrase()

shallow(<ItemContent content={text} />)
.children()
.at(0)
.should.contain.text(text)
})
})
})
14 changes: 0 additions & 14 deletions test/specs/views/Item/ItemDescription-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import faker from 'faker'
import React from 'react'

import ItemDescription from 'src/views/Item/ItemDescription'
import * as common from 'test/specs/commonTests'

Expand All @@ -9,15 +6,4 @@ describe('ItemDescription', () => {
common.rendersChildren(ItemDescription)

common.implementsCreateMethod(ItemDescription)

describe('content prop', () => {
it('renders text', () => {
const text = faker.hacker.phrase()

shallow(<ItemDescription content={text} />)
.children()
.at(0)
.should.contain.text(text)
})
})
})
14 changes: 0 additions & 14 deletions test/specs/views/Item/ItemExtra-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import faker from 'faker'
import React from 'react'

import ItemExtra from 'src/views/Item/ItemExtra'
import * as common from 'test/specs/commonTests'

Expand All @@ -9,15 +6,4 @@ describe('ItemExtra', () => {
common.rendersChildren(ItemExtra)

common.implementsCreateMethod(ItemExtra)

describe('content prop', () => {
it('renders text', () => {
const text = faker.hacker.phrase()

shallow(<ItemExtra content={text} />)
.children()
.at(0)
.should.contain.text(text)
})
})
})
14 changes: 0 additions & 14 deletions test/specs/views/Item/ItemHeader-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import faker from 'faker'
import React from 'react'

import ItemHeader from 'src/views/Item/ItemHeader'
import * as common from 'test/specs/commonTests'

Expand All @@ -9,15 +6,4 @@ describe('ItemHeader', () => {
common.rendersChildren(ItemHeader)

common.implementsCreateMethod(ItemHeader)

describe('content prop', () => {
it('renders text', () => {
const text = faker.hacker.phrase()

shallow(<ItemHeader content={text} />)
.children()
.at(0)
.should.contain.text(text)
})
})
})
14 changes: 0 additions & 14 deletions test/specs/views/Item/ItemMeta-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import faker from 'faker'
import React from 'react'

import ItemMeta from 'src/views/Item/ItemMeta'
import * as common from 'test/specs/commonTests'

Expand All @@ -9,15 +6,4 @@ describe('ItemMeta', () => {
common.rendersChildren(ItemMeta)

common.implementsCreateMethod(ItemMeta)

describe('content prop', () => {
it('renders text', () => {
const text = faker.hacker.phrase()

shallow(<ItemMeta content={text} />)
.children()
.at(0)
.should.contain.text(text)
})
})
})
17 changes: 0 additions & 17 deletions test/specs/views/Stastistic/StatisticLabel-test.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,7 @@
import faker from 'faker'
import React from 'react'

import StatisticLabel from 'src/views/Statistic/StatisticLabel'
import * as common from 'test/specs/commonTests'

describe('StatisticLabel', () => {
common.isConformant(StatisticLabel)
common.rendersChildren(StatisticLabel)

it('renders an div element', () => {
shallow(<StatisticLabel />)
.should.have.tagName('div')
})

it('renders text with label prop', () => {
const text = faker.hacker.phrase()

shallow(<StatisticLabel label={text} />)
.children()
.at(0)
.should.contain.text(text)
})
})
10 changes: 0 additions & 10 deletions test/specs/views/Stastistic/StatisticValue-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import faker from 'faker'
import React from 'react'

import StatisticValue from 'src/views/Statistic/StatisticValue'
Expand All @@ -9,14 +8,5 @@ describe('StatisticValue', () => {
common.rendersChildren(StatisticValue)

common.propKeyOnlyToClassName(StatisticValue, 'text')

it('renders text with label prop', () => {
const text = faker.hacker.phrase()

shallow(<StatisticValue value={text} />)
.children()
.at(0)
.should.contain.text(text)
})
})

21 changes: 0 additions & 21 deletions test/utils/shallow.js

This file was deleted.

0 comments on commit 11fef64

Please sign in to comment.