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

Commit

Permalink
Merge pull request #2 from ecmwf-projects/COPDS-1409
Browse files Browse the repository at this point in the history
Quality Assurance aside block.
  • Loading branch information
pelusanchez authored Nov 23, 2023
2 parents c683508 + 7f1c33c commit 193b692
Show file tree
Hide file tree
Showing 17 changed files with 7,169 additions and 14,216 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,27 @@ yarn version --preminor

yarn version --premajor
```

## Publishing a new version

Local package development:

In order to install this package locally (while developing) in the same way as publishing,
we can package it and install in webportal:

```
npm run build
npm pack
```

This will create a ecmwf-projects-cads-blocks-...-.tgz. Add to the dependencies of cads-webportal:

Something like this:

```
"dependencies": {
"@ecmwf-projects/cads-blocks-library": "file:/path/to/cads-blocks-library/ecmwf-projects-cads-blocks-library-3.0.5.tgz",
}
```

Issue yarn install.
8 changes: 5 additions & 3 deletions __tests__/components/GenerateBlocks.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Generate layout from JSON', () => {
expect(h1?.id).toBe(`abstract-1`)
expect(h1?.innerHTML).toBe(`Here's a Heading`)

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

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

screen.getByText('title text section')
screen.getByText('description text example')
const link = document.querySelector('a')
const link = document.querySelector('a:not(.anchor)') as HTMLAnchorElement
expect(link?.href).toBe('https://support.ecmwf.int/')
expect(link?.target).toBe('_blank')
})
Expand Down Expand Up @@ -127,7 +127,9 @@ describe('Generate layout from JSON', () => {
]}
/>,
)
expect(element.container).toBeEmptyDOMElement()

// Check that we only have an anchor
expect(element.container.childElementCount).toBe(1)
})
})
})
Expand Down
20 changes: 20 additions & 0 deletions __tests__/components/blocks/CheckItem.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react'
import { render } from '@testing-library/react'

import { CheckItem } from '../../../src/components'

describe('type checkitem', () => {
it('it renders correctly', () => {
render(
<CheckItem
block={{
"id": "qa_general_accuracy_and_consistency",
"href": "?tab=quality-assessment#qa_general_accuracy_and_consistency",
"type": "checkitem",
"title": "Accuracy and Consistency",
"status": "OK"
}}
/>,
)
})
})
Loading

0 comments on commit 193b692

Please sign in to comment.