Skip to content

Commit 238317a

Browse files
committed
msw/crate: Add trustpubOnly field
1 parent 584d849 commit 238317a

File tree

11 files changed

+20
-0
lines changed

11 files changed

+20
-0
lines changed

packages/crates-io-msw/handlers/crates/get.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ test('returns a crate object for known crates', async function () {
4141
num_versions: 1,
4242
repository: null,
4343
recent_downloads: 321,
44+
trustpub_only: false,
4445
updated_at: '2017-02-24T12:34:56Z',
4546
versions: [1],
4647
yanked: false,
@@ -122,6 +123,7 @@ test('works for non-canonical names', async function () {
122123
num_versions: 1,
123124
repository: null,
124125
recent_downloads: 321,
126+
trustpub_only: false,
125127
updated_at: '2017-02-24T12:34:56Z',
126128
versions: [1],
127129
yanked: false,

packages/crates-io-msw/handlers/crates/list.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ test('returns a paginated crates list', async function () {
5858
num_versions: 2,
5959
repository: null,
6060
recent_downloads: 321,
61+
trustpub_only: false,
6162
updated_at: '2017-02-24T12:34:56Z',
6263
versions: null,
6364
yanked: false,

packages/crates-io-msw/handlers/summary.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ test('returns the data for the front page', async function () {
5454
num_versions: 1,
5555
recent_downloads: 321,
5656
repository: null,
57+
trustpub_only: false,
5758
updated_at: '2017-02-24T12:34:56Z',
5859
versions: null,
5960
yanked: false,
@@ -85,6 +86,7 @@ test('returns the data for the front page', async function () {
8586
num_versions: 1,
8687
repository: null,
8788
recent_downloads: 963,
89+
trustpub_only: false,
8890
updated_at: '2017-02-24T12:34:56Z',
8991
versions: null,
9092
yanked: false,
@@ -116,6 +118,7 @@ test('returns the data for the front page', async function () {
116118
num_versions: 1,
117119
repository: null,
118120
recent_downloads: 3852,
121+
trustpub_only: false,
119122
updated_at: '2017-02-24T12:34:56Z',
120123
versions: null,
121124
yanked: false,
@@ -147,6 +150,7 @@ test('returns the data for the front page', async function () {
147150
num_versions: 1,
148151
repository: null,
149152
recent_downloads: 1605,
153+
trustpub_only: false,
150154
updated_at: '2017-02-24T12:34:56Z',
151155
versions: null,
152156
yanked: false,

packages/crates-io-msw/models/crate-owner-invitation.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ test('happy path', ({ expect }) => {
4747
"name": "crate-1",
4848
"recent_downloads": 321,
4949
"repository": null,
50+
"trustpubOnly": false,
5051
"updated_at": "2017-02-24T12:34:56Z",
5152
Symbol(type): "crate",
5253
Symbol(primaryKey): "id",

packages/crates-io-msw/models/crate-ownership.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ test('can set `team`', ({ expect }) => {
4545
"name": "crate-1",
4646
"recent_downloads": 321,
4747
"repository": null,
48+
"trustpubOnly": false,
4849
"updated_at": "2017-02-24T12:34:56Z",
4950
Symbol(type): "crate",
5051
Symbol(primaryKey): "id",
@@ -88,6 +89,7 @@ test('can set `user`', ({ expect }) => {
8889
"name": "crate-1",
8990
"recent_downloads": 321,
9091
"repository": null,
92+
"trustpubOnly": false,
9193
"updated_at": "2017-02-24T12:34:56Z",
9294
Symbol(type): "crate",
9395
Symbol(primaryKey): "id",

packages/crates-io-msw/models/crate.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default {
1616
updated_at: String,
1717
badges: Array,
1818
_extra_downloads: Array,
19+
trustpubOnly: Boolean,
1920

2021
categories: manyOf('category'),
2122
keywords: manyOf('keyword'),
@@ -31,5 +32,6 @@ export default {
3132
applyDefault(attrs, 'repository', () => null);
3233
applyDefault(attrs, 'created_at', () => '2010-06-16T21:30:45Z');
3334
applyDefault(attrs, 'updated_at', () => '2017-02-24T12:34:56Z');
35+
applyDefault(attrs, 'trustpubOnly', () => false);
3436
},
3537
};

packages/crates-io-msw/models/crate.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ test('default are applied', ({ expect }) => {
1919
"name": "crate-1",
2020
"recent_downloads": 321,
2121
"repository": null,
22+
"trustpubOnly": false,
2223
"updated_at": "2017-02-24T12:34:56Z",
2324
Symbol(type): "crate",
2425
Symbol(primaryKey): "id",
@@ -76,6 +77,7 @@ test('attributes can be set', ({ expect }) => {
7677
"name": "crates-io",
7778
"recent_downloads": 321,
7879
"repository": null,
80+
"trustpubOnly": false,
7981
"updated_at": "2017-02-24T12:34:56Z",
8082
Symbol(type): "crate",
8183
Symbol(primaryKey): "id",

packages/crates-io-msw/models/dependency.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ test('happy path', ({ expect }) => {
3636
"name": "crate-1",
3737
"recent_downloads": 321,
3838
"repository": null,
39+
"trustpubOnly": false,
3940
"updated_at": "2017-02-24T12:34:56Z",
4041
Symbol(type): "crate",
4142
Symbol(primaryKey): "id",
@@ -62,6 +63,7 @@ test('happy path', ({ expect }) => {
6263
"name": "crate-2",
6364
"recent_downloads": 1926,
6465
"repository": null,
66+
"trustpubOnly": false,
6567
"updated_at": "2017-02-24T12:34:56Z",
6668
Symbol(type): "crate",
6769
Symbol(primaryKey): "id",

packages/crates-io-msw/models/trustpub/gitlab-config.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ test('defaults are applied', ({ expect }) => {
2121
"name": "crate-1",
2222
"recent_downloads": 321,
2323
"repository": null,
24+
"trustpubOnly": false,
2425
"updated_at": "2017-02-24T12:34:56Z",
2526
Symbol(type): "crate",
2627
Symbol(primaryKey): "id",
@@ -64,6 +65,7 @@ test('fields can be set', ({ expect }) => {
6465
"name": "serde",
6566
"recent_downloads": 321,
6667
"repository": null,
68+
"trustpubOnly": false,
6769
"updated_at": "2017-02-24T12:34:56Z",
6870
Symbol(type): "crate",
6971
Symbol(primaryKey): "id",

packages/crates-io-msw/models/version-download.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ test('happy path', ({ expect }) => {
3232
"name": "crate-1",
3333
"recent_downloads": 321,
3434
"repository": null,
35+
"trustpubOnly": false,
3536
"updated_at": "2017-02-24T12:34:56Z",
3637
Symbol(type): "crate",
3738
Symbol(primaryKey): "id",

0 commit comments

Comments
 (0)