Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit 193b692

Browse files
authored
Merge pull request #2 from ecmwf-projects/COPDS-1409
Quality Assurance aside block.
2 parents c683508 + 7f1c33c commit 193b692

17 files changed

+7169
-14216
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,27 @@ yarn version --preminor
4343

4444
yarn version --premajor
4545
```
46+
47+
## Publishing a new version
48+
49+
Local package development:
50+
51+
In order to install this package locally (while developing) in the same way as publishing,
52+
we can package it and install in webportal:
53+
54+
```
55+
npm run build
56+
npm pack
57+
```
58+
59+
This will create a ecmwf-projects-cads-blocks-...-.tgz. Add to the dependencies of cads-webportal:
60+
61+
Something like this:
62+
63+
```
64+
"dependencies": {
65+
"@ecmwf-projects/cads-blocks-library": "file:/path/to/cads-blocks-library/ecmwf-projects-cads-blocks-library-3.0.5.tgz",
66+
}
67+
```
68+
69+
Issue yarn install.

__tests__/components/GenerateBlocks.test.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('Generate layout from JSON', () => {
3535
expect(h1?.id).toBe(`abstract-1`)
3636
expect(h1?.innerHTML).toBe(`Here's a Heading`)
3737

38-
const anchor = element.container.querySelector('a')
38+
const anchor = element.container.querySelector('a:not(.anchor)')
3939
expect(anchor?.innerHTML).toBe(`link`)
4040
expect(anchor).toHaveAttribute('href', 'https://google.com')
4141

@@ -69,7 +69,7 @@ describe('Generate layout from JSON', () => {
6969

7070
screen.getByText('title text section')
7171
screen.getByText('description text example')
72-
const link = document.querySelector('a')
72+
const link = document.querySelector('a:not(.anchor)') as HTMLAnchorElement
7373
expect(link?.href).toBe('https://support.ecmwf.int/')
7474
expect(link?.target).toBe('_blank')
7575
})
@@ -127,7 +127,9 @@ describe('Generate layout from JSON', () => {
127127
]}
128128
/>,
129129
)
130-
expect(element.container).toBeEmptyDOMElement()
130+
131+
// Check that we only have an anchor
132+
expect(element.container.childElementCount).toBe(1)
131133
})
132134
})
133135
})
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react'
2+
import { render } from '@testing-library/react'
3+
4+
import { CheckItem } from '../../../src/components'
5+
6+
describe('type checkitem', () => {
7+
it('it renders correctly', () => {
8+
render(
9+
<CheckItem
10+
block={{
11+
"id": "qa_general_accuracy_and_consistency",
12+
"href": "?tab=quality-assessment#qa_general_accuracy_and_consistency",
13+
"type": "checkitem",
14+
"title": "Accuracy and Consistency",
15+
"status": "OK"
16+
}}
17+
/>,
18+
)
19+
})
20+
})

0 commit comments

Comments
 (0)