Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #90 from uktrade/feature/FEX-12-activity-stream-ex…
Browse files Browse the repository at this point in the history
…ternal-sources-front-end

feat: Create external sources activity cards
  • Loading branch information
yozzo authored Aug 19, 2019
2 parents cc5a338 + ba939f4 commit dc0652a
Show file tree
Hide file tree
Showing 23 changed files with 1,797 additions and 469 deletions.
42 changes: 23 additions & 19 deletions fixtures/activity_feed/companies_house/accounts_are_due.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
{
"id": "dit:companiesHouse:1:Announce",
"type": "Announce",
"published": "2019-01-18T08:43:40.904649+00:00",

"dit:dataSource": {
"id": "companies_house.accounts",
"name": "Companies House (Accounts)"
},
"generator": {
"name": "dit:companiesHouse",
"name": "dit:dataScienceLab",
"type": "Application"
},

"id": "dit:DataScienceExport:5d39ab9ac0d4899610cd65e4:Announce",
"object": {
"id": "dit:companiesHouse:1",
"name": "Accounts due date"
},

"context": {
"id": "dit:DataHubCompany:a4ead59f-dfc8-e511-a5e6-e4115bead28a",
"dit:dunsNumber": "123456789",
"dit:companiesHouseNumber": "987654321",
"dit:balanceSheetDate": "2019-07-27",
"dit:companiesHouseRegisteredNumber": 5603,
"dit:companyStatus": "Dormant",
"dit:entityCurrentLegalName": "ENJOLA",
"dit:netAssetsLiabilitiesIncludingPensionAssetLiability": 1,
"dit:periodEnd": "2019-07-27",
"dit:periodStart": "2019-07-27",
"dit:shareholderFunds": 1,
"dit:taxonomy": "http://some.url/with/stuff/2019-07-27",
"id": "dit:externalSources:companies_house.accounts:5d39ab9ac0d4899610cd65e4",
"type": [
"Organization",
"dit:Company"
],
"name": "Marco Test"
}
"Event",
"dit:Accounts"
]
},
"published": "2020-12-13T01:11:18",
"summary": "Company officially incorporated in Companies House.",
"type": "Announce"
}
59 changes: 42 additions & 17 deletions fixtures/activity_feed/companies_house/incorporated.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,51 @@
{
"id": "dit:companiesHouse:2:Announce",
"type": "Announce",
"published": "2019-01-18T08:43:40.904649+00:00",

"dit:dataSource": {
"id": "companies_house.companies",
"name": "Companies House (Companies)"
},
"generator": {
"name": "dit:companiesHouse",
"name": "dit:dataScienceLab",
"type": "Application"
},

"id": "dit:DataScienceExport:7:Announce",
"object": {
"id": "dit:companiesHouse:1",
"name": "Company officially incorporated in Companies House"
},

"context": {
"id": "dit:DataHubCompany:a4ead59f-dfc8-e511-a5e6-e4115bead28a",
"dit:dunsNumber": "123456789",
"dit:companiesHouseNumber": "987654321",
"attributedTo": [
{
"dit:companiesHouseNumber": 9061,
"id": "dit:DataScienceCompany:7",
"location": {
"dit:address": "757 Williamsburg Street, Vandiver",
"dit:postcode": 444101
},
"name": "SULTRAX",
"type": [
"Organization",
"dit:Company"
]
}
],
"dit:accountRefDay": 21,
"dit:accountRefMonth": 6,
"dit:companiesHouseId": 9061,
"dit:confStmtLastMadeUpDate": "2019-06-17T12:25:14",
"dit:confStmtNextDueDate": "2019-08-05T06:39:45",
"dit:incorporationDate": "1970-10-03T02:18:21",
"dit:lastMadeUpDate": "2019-04-18T06:56:31",
"dit:nextDueDate": "2019-08-10T10:42:00",
"dit:returnsLastMadeUpDate": "2019-06-28T03:10:12",
"dit:returnsNextDueDate": "2017-09-20T02:37:45",
"dit:sicCodes": [
"74990 - Non-trading company",
"03110 - Marine fishing",
"99000 - Activities of extraterritorial organisations and bodies"
],
"id": "dit:externalSources:companies_house.companies:7",
"type": [
"Organization",
"dit:Company"
],
"name": "Marco Test"
}
]
},
"published": "1970-10-03T02:18:21",
"summary": "SULTRAX officially did action number 10.",
"type": "Announce"
}
59 changes: 37 additions & 22 deletions fixtures/activity_feed/hmrc/export_of_goods.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,46 @@
{
"id": "dit:hmrc:1:Announce",
"type": "Announce",
"published": "2019-01-18T08:43:40.904649+00:00",

"dit:dataSource": {
"id": "hmrc.exporters",
"name": "HMRC (Exporters)"
},
"generator": {
"name": "dit:hmrc",
"name": "dit:dataScienceLab",
"type": "Application"
},

"id": "dit:DataScienceExport:5d39b0c9a2b09a36f9f243bf:Announce",
"published": "1879-01-05T06:53:47",
"summary": "The Water Company officially did action number 5.",
"type": "Announce",
"object": {
"id": "dit:hmrc:1",
"name": "Export of goods",

"dit:commodityCodes": [
"84351000",
"84359000"
]
},

"context": {
"id": "dit:DataHubCompany:a4ead59f-dfc8-e511-a5e6-e4115bead28a",
"dit:dunsNumber": "123456789",
"dit:companiesHouseNumber": "987654321",
"id": "dit:externalSources:hmrc.exporters:5d39b0c9a2b09a36f9f243bf",
"type": [
"Organization",
"dit:Company"
"Event",
"dit:Export"
],
"dit:exportItemCodes": [
2803406,
7252793,
5163497,
6477617,
3158924,
5735446,
4517493
],
"name": "Marco Test"
"dit:datetime": "1879-01-05T06:53:47",
"attributedTo": [
{
"id": "dit:DataScienceCompany:5d39b0c9a2b09a36f9f243bf",
"type": [
"Organization",
"dit:Company"
],
"name": "The Water Company",
"location": {
"dit:address": "179 Henry Street, Shawmut",
"dit:postcode": 475481
},
"dit:companiesHouseNumber": 7581
}
]
}
}
3 changes: 3 additions & 0 deletions fixtures/activity_feed/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = [
require('./companies_house/accounts_are_due'),
require('./companies_house/incorporated'),
require('./hmrc/export_of_goods'),
require('./interactions/interaction'),
require('./interactions/investment_project'),
require('./interactions/service_delivery'),
Expand Down
35 changes: 35 additions & 0 deletions src/activity-feed/ActivityFeedCard.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { set } from 'lodash'

import MockDate from 'mockdate'
import ActivityFeedCard from './ActivityFeedCard'
import companiesHouseAccountsDueFixture from '../../fixtures/activity_feed/companies_house/accounts_are_due'
import companiesHouseCompaniesFixture from '../../fixtures/activity_feed/companies_house/incorporated'
import hmrcExportersFixture from '../../fixtures/activity_feed/hmrc/export_of_goods'
import interactionActivityFixture from '../../fixtures/activity_feed/interactions/interaction'
import serviceDeliveryActivityFixture from '../../fixtures/activity_feed/interactions/service_delivery'
import investmentProjectsCTIFixture from '../../fixtures/activity_feed/investment_projects/project_added_cti'
Expand Down Expand Up @@ -170,4 +173,36 @@ describe('ActivityFeedCard', () => {
expect(tree).toMatchSnapshot()
})
})

describe('when there is a Companies House Accounts record', () => {
test('should render an activity card', () => {
const companiesHouseAccountsDue = { ...companiesHouseAccountsDueFixture }
const tree = renderer
.create(<ActivityFeedCard activity={companiesHouseAccountsDue} showDetails={false} />)
.toJSON()
expect(tree).toMatchSnapshot()
})
})

describe('when there is a Companies House Company incorporation record', () => {
test('should render an activity card', () => {
const companiesHouseCompanyIncorporated = { ...companiesHouseCompaniesFixture }
const tree = renderer
.create(<ActivityFeedCard
activity={companiesHouseCompanyIncorporated}
showDetails={false}
/>)
.toJSON()
expect(tree).toMatchSnapshot()
})
})

describe('when there is a HMRC Exporter record', () => {
test('should render an activity card', () => {
const tree = renderer
.create(<ActivityFeedCard activity={hmrcExportersFixture} showDetails={false} />)
.toJSON()
expect(tree).toMatchSnapshot()
})
})
})
Loading

0 comments on commit dc0652a

Please sign in to comment.