Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
oklemenz2 committed Mar 24, 2024
1 parent 31f9e5a commit db9e3e1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/_env/srv/cache.cds
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ using test from './main';
service CacheService {

entity Header as projection on test.Header;

entity HeaderMore as projection on Header {
*,
virtual null as dueAt: Date
}
}
19 changes: 19 additions & 0 deletions test/cache.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,23 @@ describe("rest", () => {
expect(response.body).toBeDefined();
expect(response.text).toMatchSnapshot();
});

it("GET Entity cache via prototype works", async () => {
let response = await util.callWrite(request, "/odata/v2/cache/Header", {
name: "Test"
}, false, {
accept: "application/xml",
});
expect(response.status).toBe(201)
expect(response.body).toBeDefined();

response = await util.callWrite(request, "/odata/v2/cache/HeaderMore", {
name: "Test",
dueAt: "/Date(1711152000000)/"
}, false, {
accept: "application/xml",
});
expect(response.status).toBe(201)
expect(response.body).toBeDefined();
});
});

0 comments on commit db9e3e1

Please sign in to comment.