forked from code-forge-io/seo-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb-app.test.ts
More file actions
63 lines (57 loc) · 1.46 KB
/
web-app.test.ts
File metadata and controls
63 lines (57 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import type { WebApplication } from "schema-dts"
import { webApp } from "./web-app"
describe("webApp", () => {
it("should return the correct structured data", () => {
const data: WebApplication = {
"@type": "WebApplication",
name: "Example Web App",
url: "https://example.com",
browserRequirements: "Chrome 90+, Firefox 88+",
offers: {
"@type": "Offer",
price: "0.00",
priceCurrency: "USD",
},
}
expect(webApp(data)).toEqual({
"@context": "https://schema.org",
...data,
})
})
it("should return the correct structured data with an image", () => {
const data: WebApplication = {
"@type": "WebApplication",
name: "Example Web App",
url: "https://example.com",
browserRequirements: "Chrome 90+, Firefox 88+",
offers: {
"@type": "Offer",
price: "0.00",
priceCurrency: "USD",
},
image: "https://example.com/example-app.jpg",
}
expect(webApp(data)).toEqual({
"@context": "https://schema.org",
...data,
})
})
it("should return the correct structured data with a description", () => {
const data: WebApplication = {
"@type": "WebApplication",
name: "Example Web App",
url: "https://example.com",
browserRequirements: "Chrome 90+, Firefox 88+",
offers: {
"@type": "Offer",
price: "0.00",
priceCurrency: "USD",
},
description: "An example web application description.",
}
expect(webApp(data)).toEqual({
"@context": "https://schema.org",
...data,
})
})
})