Skip to content

Commit

Permalink
Update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
evert committed Jan 5, 2020
1 parent 988ad21 commit c920c15
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 33 deletions.
4 changes: 3 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
ChangeLog
=========

5.1.0 (2020-??-??)
5.1.0 (2020-01-05)
------------------

* Support for the [Collection+json][4] format.
* Added a `preferTransclude()` method on the Follower objects. This
automatically adds a `Prefer: tranclude="rel"` header.

Expand Down Expand Up @@ -553,3 +554,4 @@ ChangeLog
[1]: https://github.com/kevinswiber/siren
[2]: https://tools.ietf.org/html/draft-nottingham-linked-cache-inv-04
[3]: https://tools.ietf.org/html/draft-pot-prefer-push
[4]: http://amundsen.com/media-types/collection/format/
26 changes: 13 additions & 13 deletions test/unit/representor/collection-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import CollectionJson from '../../../src/representor/collection-json';
describe('collection+json representor', () => {

it('should parse the "Minimal Representation" example', () => {
const exampleObj = { "collection" :

const exampleObj = { "collection" :
{
"version" : "1.0",

"href" : "http://example.org/friends/"
}
}
};

const cj = new CollectionJson(
Expand All @@ -30,11 +30,11 @@ describe('collection+json representor', () => {
{
"version" : "1.0",
"href" : "http://example.org/friends/",

"links" : [
{"rel" : "feed", "href" : "http://example.org/friends/rss"}
],

"items" : [
{
"href" : "http://example.org/friends/jdoe",
Expand All @@ -47,7 +47,7 @@ describe('collection+json representor', () => {
{"rel" : "avatar", "href" : "http://examples.org/images/jdoe", "prompt" : "Avatar", "render" : "image"}
]
},

{
"href" : "http://example.org/friends/msmith",
"data" : [
Expand All @@ -59,7 +59,7 @@ describe('collection+json representor', () => {
{"rel" : "avatar", "href" : "http://examples.org/images/msmith", "prompt" : "Avatar", "render" : "image"}
]
},

{
"href" : "http://example.org/friends/rwilliams",
"data" : [
Expand All @@ -70,9 +70,9 @@ describe('collection+json representor', () => {
{"rel" : "blog", "href" : "http://examples.org/blogs/rwilliams", "prompt" : "Blog"},
{"rel" : "avatar", "href" : "http://examples.org/images/rwilliams", "prompt" : "Avatar", "render" : "image"}
]
}
}
],

"queries" : [
{"rel" : "search", "href" : "http://example.org/friends/search", "prompt" : "Search",
"data" : [
Expand All @@ -81,17 +81,17 @@ describe('collection+json representor', () => {
},
{"rel" : "get-new", "href" : "http://example.org/friends/new", "prompt" : "New friends" },
],

"template" : {
"data" : [
{"name" : "full-name", "value" : "", "prompt" : "Full Name"},
{"name" : "email", "value" : "", "prompt" : "Email"},
{"name" : "blog", "value" : "", "prompt" : "Blog"},
{"name" : "avatar", "value" : "", "prompt" : "Avatar"}

]
}
}
}
};

const cj = new CollectionJson(
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('collection+json representor', () => {
]
},
],
}
}
};

const cj = new CollectionJson(
Expand Down
38 changes: 19 additions & 19 deletions test/unit/representor/siren.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ import Siren from '../../../src/representor/siren';
describe('Siren representor', () => {

it('should parse the example Siren object', () => {

const exampleObj = {
"class": [ "order" ],
"properties": {
"orderNumber": 42,
"properties": {
"orderNumber": 42,
"itemCount": 3,
"status": "pending"
},
"entities": [
{
"class": [ "items", "collection" ],
"rel": [ "http://x.io/rels/order-items" ],
{
"class": [ "items", "collection" ],
"rel": [ "http://x.io/rels/order-items" ],
"href": "http://api.x.io/orders/42/items"
},
{
"class": [ "info", "customer" ],
"rel": [ "http://x.io/rels/customer" ],
"properties": {
"rel": [ "http://x.io/rels/customer" ],
"properties": {
"customerId": "pj123",
"name": "Peter Joseph"
},
Expand Down Expand Up @@ -81,11 +81,11 @@ describe('Siren representor', () => {
]);

expect(siren.getEmbedded()).to.eql({
'http://api.x.io/customers/pj123':
'http://api.x.io/customers/pj123':
{
"class": [ "info", "customer" ],
"rel": [ "http://x.io/rels/customer" ],
"properties": {
"rel": [ "http://x.io/rels/customer" ],
"properties": {
"customerId": "pj123",
"name": "Peter Joseph"
},
Expand All @@ -101,8 +101,8 @@ describe('Siren representor', () => {

const input = {
"class": [ "order" ],
"properties": {
"orderNumber": 42,
"properties": {
"orderNumber": 42,
"itemCount": 3,
"status": "pending"
},
Expand All @@ -120,16 +120,16 @@ describe('Siren representor', () => {

const input:any = {
"class": [ "order" ],
"properties": {
"orderNumber": 42,
"properties": {
"orderNumber": 42,
"itemCount": 3,
"status": "pending"
},
"entities": [
{
"class": [ "info", "customer" ],
"rel": [ "http://x.io/rels/customer" ],
"properties": {
"rel": [ "http://x.io/rels/customer" ],
"properties": {
"customerId": "pj123",
"name": "Peter Joseph"
},
Expand All @@ -139,8 +139,8 @@ describe('Siren representor', () => {
},
{
"class": [ "info", "customer" ],
"rel": [ "http://x.io/rels/customer" ],
"properties": {
"rel": [ "http://x.io/rels/customer" ],
"properties": {
"customerId": "pj123",
"name": "Peter Joseph"
},
Expand Down

0 comments on commit c920c15

Please sign in to comment.