Skip to content

Commit

Permalink
Merge branch 'master' into fiori-currency-format
Browse files Browse the repository at this point in the history
  • Loading branch information
chgeo authored May 28, 2021
2 parents ad417ec + be87f56 commit 20bfb5c
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 14 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion bookshop/app/vue/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const books = new Vue ({
try {
const res = await POST(`/submitOrder`, { amount, book: book.ID })
book.stock = res.data.stock
books.order = { amount, succeeded: `Successfully orderd ${amount} item(s).` }
books.order = { amount, succeeded: `Successfully ordered ${amount} item(s).` }
} catch (e) {
books.order = { amount, failed: e.response.data.error.message }
}
Expand Down
4 changes: 2 additions & 2 deletions fiori/app/admin/fiori-service.cds
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ annotate AdminService.Authors with @(
annotate sap.capire.bookshop.Books with @fiori.draft.enabled;
annotate AdminService.Books with @odata.draft.enabled;

annotate AdminService.Books_texts with @(
annotate AdminService.Books.texts with @(
UI: {
Identification: [{Value:title}],
SelectionFields: [ locale, title ],
Expand All @@ -83,7 +83,7 @@ annotate AdminService.Books_texts with @(
);

// Add Value Help for Locales
annotate AdminService.Books_texts {
annotate AdminService.Books.texts {
locale @ValueList:{entity:'Languages',type:#fixed}
}
// In addition we need to expose Languages through AdminService
Expand Down
2 changes: 1 addition & 1 deletion fiori/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@capire/reviews": "*",
"@capire/orders": "*",
"@capire/common": "*",
"@sap/cds": ">=4",
"@sap/cds": "^5",
"express": "^4.17.1",
"passport": "^0.4.1"
},
Expand Down
2 changes: 1 addition & 1 deletion orders/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "@capire/orders",
"version": "1.0.0",
"dependencies": {
"@sap/cds": ">=4.3.0"
"@sap/cds": "^5"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"fiori": "cds watch fiori",
"media": "cds watch media",
"mocha": "npx mocha || echo",
"jest": "npx jest",
"jest": "npx jest@^26",
"test": "npm run jest --silent"
},
"mocha": {
Expand Down
2 changes: 1 addition & 1 deletion reviews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"index.cds"
],
"dependencies": {
"@sap/cds": ">=4",
"@sap/cds": "^5",
"express": "^4.17.1"
},
"scripts": {
Expand Down
10 changes: 3 additions & 7 deletions test/custom-handlers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ else cds.User = cds.User.Privileged // hard core monkey patch for older cds rele
describe('Custom Handlers', () => {

it('should reject out-of-stock orders', async () => {
await expect(
Promise.all([
POST('/browse/submitOrder', { book: 201, amount: 5 }),
POST('/browse/submitOrder', { book: 201, amount: 5 }),
POST('/browse/submitOrder', { book: 201, amount: 5 }),
])
).to.be.rejectedWith(/409 - 5 exceeds stock for book #201/)
await POST('/browse/submitOrder', { book: 201, amount: 5 })
await POST('/browse/submitOrder', { book: 201, amount: 5 })
await expect(POST('/browse/submitOrder', { book: 201, amount: 5 })).to.be.rejectedWith(/409 - 5 exceeds stock for book #201/)
const { data } = await GET`/admin/Books/201/stock/$value`
expect(data).to.equal(2)
})
Expand Down

0 comments on commit 20bfb5c

Please sign in to comment.