Skip to content

Commit

Permalink
Merge pull request #576 from terrestris/tests
Browse files Browse the repository at this point in the history
fix: tests and introduce pipeline for v5-main branch
  • Loading branch information
ahennr authored Jun 24, 2024
2 parents 6339788 + 7b29837 commit ade1633
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test successful build of mapfish print manager (v5-main)

on: pull_request

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Cache Node.js modules 💾
uses: actions/cache@v3
with:
path: ~/.npm
key: "${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies ⏬
run: npm install

- name: Run tests 🩺
run: npm run test

- name: Build artifacts 🏗️
run: npm run build:dist
29 changes: 28 additions & 1 deletion spec/serializer/MapFishPrintV3GeoJsonSerializer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ describe('MapFishPrintV3GeoJsonSerializer', () => {
coordinates: [0, 0]
},
properties: {
'_style': 0
}
}, {
type: 'Feature',
Expand All @@ -87,6 +88,7 @@ describe('MapFishPrintV3GeoJsonSerializer', () => {
coordinates: [[0, 0], [1, 1]]
},
properties: {
'_style': 1
}
}, {
type: 'Feature',
Expand All @@ -95,12 +97,37 @@ describe('MapFishPrintV3GeoJsonSerializer', () => {
coordinates: [[[0, 0], [1, 1], [0, 0]]]
},
properties: {
'_style': 2
}
}]
},
name: layer.get('name') || 'Vector Layer',
opacity: layer.getOpacity(),
style: {},
style: {
'0': {
fillColor: '#ffffff',
fillOpacity: 0.4,
graphicName: 'circle',
pointRadius: 5,
rotation: 0,
strokeColor: '#3399cc',
strokeOpacity: 1,
strokeWidth: 1.25,
version: 2,
},
'1': {
strokeColor: '#3399cc',
strokeOpacity: 1,
strokeWidth: 1.25,
},
'2': {
fillColor: '#ffffff',
fillOpacity: 0.4,
strokeColor: '#3399cc',
strokeOpacity: 1,
strokeWidth: 1.25,
},
},
type: 'geojson'
});
});
Expand Down

0 comments on commit ade1633

Please sign in to comment.