Skip to content

Commit

Permalink
test: add snapshots for adobe provider
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Mar 23, 2024
1 parent 61e4b86 commit c1dc27e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,31 @@ describe('providers', async () => {
`)
})

it('generates inlined font face rules for `adobe` provider', async () => {
const html = await $fetch('/providers/adobe')
expect(extractFontFaces('Aleo', html)).toMatchInlineSnapshot(`
[
"@font-face{font-family:Aleo;src:local("Aleo Regular"),local("Aleo"),url(/_fonts/file.woff2) format(woff2),url(/_fonts/file.woff) format(woff),url(/_fonts/file.otf) format(opentype);font-display:auto;font-weight:400;font-style:normal}",
"@font-face{font-family:Aleo;src:local("Aleo Regular Italic"),local("Aleo Italic"),url(/_fonts/file.woff2) format(woff2),url(/_fonts/file.woff) format(woff),url(/_fonts/file.otf) format(opentype);font-display:auto;font-weight:400;font-style:italic}",
"@font-face{font-family:Aleo;src:local("Aleo Bold"),url(/_fonts/file.woff2) format(woff2),url(/_fonts/file.woff) format(woff),url(/_fonts/file.otf) format(opentype);font-display:auto;font-weight:700;font-style:normal}",
"@font-face{font-family:Aleo;src:local("Aleo Bold Italic"),url(/_fonts/file.woff2) format(woff2),url(/_fonts/file.woff) format(woff),url(/_fonts/file.otf) format(opentype);font-display:auto;font-weight:700;font-style:italic}",
]
`)
})

it('generates inlined font face rules for `adobe` provider', async () => {
const html = await $fetch('/providers/adobe2')
expect(extractFontFaces('Barlow Semi Condensed', html)).toMatchInlineSnapshot(`
[
"@font-face{font-family:Barlow Semi Condensed;src:local("Barlow Semi Condensed Bold"),url(/_fonts/file.woff2) format(woff2),url(/_fonts/file.woff) format(woff),url(/_fonts/file.otf) format(opentype);font-display:auto;font-weight:700;font-style:normal}",
"@font-face{font-family:Barlow Semi Condensed;src:local("Barlow Semi Condensed Regular Italic"),local("Barlow Semi Condensed Italic"),url(/_fonts/file.woff2) format(woff2),url(/_fonts/file.woff) format(woff),url(/_fonts/file.otf) format(opentype);font-display:auto;font-weight:400;font-style:italic}",
"@font-face{font-family:Barlow Semi Condensed;src:local("Barlow Semi Condensed Bold Italic"),url(/_fonts/file.woff2) format(woff2),url(/_fonts/file.woff) format(woff),url(/_fonts/file.otf) format(opentype);font-display:auto;font-weight:700;font-style:italic}",
"@font-face{font-family:Barlow Semi Condensed;src:local("Barlow Semi Condensed Regular"),local("Barlow Semi Condensed"),url(/_fonts/file.woff2) format(woff2),url(/_fonts/file.woff) format(woff),url(/_fonts/file.otf) format(opentype);font-display:auto;font-weight:400;font-style:normal}",
]
`)
})


it('generates inlined font face rules for `bunny` provider', async () => {
const html = await $fetch('/providers/bunny')
expect(extractFontFaces('Abel', html)).toMatchInlineSnapshot(`
Expand Down

0 comments on commit c1dc27e

Please sign in to comment.