Skip to content

Commit e58228d

Browse files
committed
print: set 2 empty divs at start and end to display: none
They produce empty pages, in case of only the picasso at start and end. Else an empty page at the end. Fixes #8026
1 parent 622f43e commit e58228d

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

e2e/specs/nuxtPrint.cy.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,10 @@ describe('Nuxt print test', () => {
8888
cy.readFile(pdfPath, {
8989
timeout: 30000,
9090
})
91-
cy.getPdfProperties(pdfPath).then((props) => cy.log(JSON.stringify(props)))
92-
cy.getPdfProperties(pdfPath).its('numPages').should('eq', 26)
93-
cy.moveDownloads()
91+
cy.getPdfProperties(pdfPath).its('numPages').should('eq', 25)
9492
})
9593

96-
it.skip('for picasso', () => {
94+
it('for picasso', () => {
9795
cy.get('a:contains("Programm")').click()
9896
cy.get('[data-testid="campprogram-menu"]').click()
9997
cy.get('[role="menuitem"] :contains("PDF herunterladen (Layout #1)")').click()
@@ -104,7 +102,6 @@ describe('Nuxt print test', () => {
104102
timeout: 30000,
105103
})
106104
cy.getPdfProperties(pdfPath).its('numPages').should('eq', 1)
107-
cy.moveDownloads()
108105
})
109106
})
110107
})

print/layouts/default.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,15 @@ useHead(header)
7676
padding: 0;
7777
}
7878
</style>
79+
80+
<!--
81+
Here we need to hack away 2 divs which nuxt generates,
82+
so these styles must be global.
83+
-->
84+
<!-- eslint-disable-next-line vue-scoped-css/enforce-style-type -->
85+
<style lang="scss">
86+
body > div > div.container > div:not(:has(*)),
87+
body > div#teleports {
88+
display: none;
89+
}
90+
</style>

0 commit comments

Comments
 (0)