@loopback/example-references-many 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/.dockerignore +5 -0
  2. package/.eslintrc.js +8 -0
  3. package/.prettierignore +2 -0
  4. package/.prettierrc +7 -0
  5. package/.vscode/settings.json +20 -0
  6. package/.vscode/tasks.json +29 -0
  7. package/CHANGELOG.md +25 -0
  8. package/Dockerfile +28 -0
  9. package/LICENSE +25 -0
  10. package/README.md +49 -0
  11. package/data/db.json +18 -0
  12. package/dist/__tests__/acceptance/account.acceptance.d.ts +1 -0
  13. package/dist/__tests__/acceptance/account.acceptance.js +111 -0
  14. package/dist/__tests__/acceptance/account.acceptance.js.map +1 -0
  15. package/dist/__tests__/acceptance/customer.acceptance.d.ts +1 -0
  16. package/dist/__tests__/acceptance/customer.acceptance.js +163 -0
  17. package/dist/__tests__/acceptance/customer.acceptance.js.map +1 -0
  18. package/dist/__tests__/acceptance/home-page.acceptance.d.ts +1 -0
  19. package/dist/__tests__/acceptance/home-page.acceptance.js +31 -0
  20. package/dist/__tests__/acceptance/home-page.acceptance.js.map +1 -0
  21. package/dist/__tests__/acceptance/test-helper.d.ts +7 -0
  22. package/dist/__tests__/acceptance/test-helper.js +20 -0
  23. package/dist/__tests__/acceptance/test-helper.js.map +1 -0
  24. package/dist/__tests__/helpers.d.ts +26 -0
  25. package/dist/__tests__/helpers.js +101 -0
  26. package/dist/__tests__/helpers.js.map +1 -0
  27. package/dist/__tests__/integration/customer.repository.integration.d.ts +1 -0
  28. package/dist/__tests__/integration/customer.repository.integration.js +61 -0
  29. package/dist/__tests__/integration/customer.repository.integration.js.map +1 -0
  30. package/dist/__tests__/unit/controllers/account.controller.unit.d.ts +1 -0
  31. package/dist/__tests__/unit/controllers/account.controller.unit.js +106 -0
  32. package/dist/__tests__/unit/controllers/account.controller.unit.js.map +1 -0
  33. package/dist/__tests__/unit/controllers/customer.controller.unit.d.ts +1 -0
  34. package/dist/__tests__/unit/controllers/customer.controller.unit.js +108 -0
  35. package/dist/__tests__/unit/controllers/customer.controller.unit.js.map +1 -0
  36. package/dist/application.d.ts +272 -0
  37. package/dist/application.js +41 -0
  38. package/dist/application.js.map +1 -0
  39. package/dist/controllers/account.controller.d.ts +15 -0
  40. package/dist/controllers/account.controller.js +192 -0
  41. package/dist/controllers/account.controller.js.map +1 -0
  42. package/dist/controllers/customer.controller.d.ts +15 -0
  43. package/dist/controllers/customer.controller.js +192 -0
  44. package/dist/controllers/customer.controller.js.map +1 -0
  45. package/dist/controllers/index.d.ts +2 -0
  46. package/dist/controllers/index.js +10 -0
  47. package/dist/controllers/index.js.map +1 -0
  48. package/dist/datasources/db.datasource.d.ts +12 -0
  49. package/dist/datasources/db.datasource.js +34 -0
  50. package/dist/datasources/db.datasource.js.map +1 -0
  51. package/dist/datasources/index.d.ts +1 -0
  52. package/dist/datasources/index.js +9 -0
  53. package/dist/datasources/index.js.map +1 -0
  54. package/dist/index.d.ts +3 -0
  55. package/dist/index.js +44 -0
  56. package/dist/index.js.map +1 -0
  57. package/dist/migrate.d.ts +1 -0
  58. package/dist/migrate.js +25 -0
  59. package/dist/migrate.js.map +1 -0
  60. package/dist/models/account.model.d.ts +9 -0
  61. package/dist/models/account.model.js +35 -0
  62. package/dist/models/account.model.js.map +1 -0
  63. package/dist/models/customer.model.d.ts +13 -0
  64. package/dist/models/customer.model.js +45 -0
  65. package/dist/models/customer.model.js.map +1 -0
  66. package/dist/models/index.d.ts +2 -0
  67. package/dist/models/index.js +10 -0
  68. package/dist/models/index.js.map +1 -0
  69. package/dist/openapi-spec.d.ts +1 -0
  70. package/dist/openapi-spec.js +28 -0
  71. package/dist/openapi-spec.js.map +1 -0
  72. package/dist/repositories/account.repository.d.ts +6 -0
  73. package/dist/repositories/account.repository.js +23 -0
  74. package/dist/repositories/account.repository.js.map +1 -0
  75. package/dist/repositories/customer.repository.d.ts +11 -0
  76. package/dist/repositories/customer.repository.js +29 -0
  77. package/dist/repositories/customer.repository.js.map +1 -0
  78. package/dist/repositories/index.d.ts +2 -0
  79. package/dist/repositories/index.js +10 -0
  80. package/dist/repositories/index.js.map +1 -0
  81. package/dist/sequence.d.ts +3 -0
  82. package/dist/sequence.js +12 -0
  83. package/dist/sequence.js.map +1 -0
  84. package/package.json +78 -0
  85. package/public/index.html +72 -0
  86. package/src/__tests__/acceptance/account.acceptance.ts +139 -0
  87. package/src/__tests__/acceptance/customer.acceptance.ts +198 -0
  88. package/src/__tests__/acceptance/home-page.acceptance.ts +36 -0
  89. package/src/__tests__/acceptance/test-helper.ts +29 -0
  90. package/src/__tests__/helpers.ts +119 -0
  91. package/src/__tests__/integration/customer.repository.integration.ts +80 -0
  92. package/src/__tests__/unit/controllers/account.controller.unit.ts +127 -0
  93. package/src/__tests__/unit/controllers/customer.controller.unit.ts +136 -0
  94. package/src/application.ts +49 -0
  95. package/src/controllers/account.controller.ts +177 -0
  96. package/src/controllers/customer.controller.ts +177 -0
  97. package/src/controllers/index.ts +7 -0
  98. package/src/datasources/db.datasource.ts +34 -0
  99. package/src/datasources/index.ts +6 -0
  100. package/src/index.ts +42 -0
  101. package/src/migrate.ts +25 -0
  102. package/src/models/account.model.ts +31 -0
  103. package/src/models/customer.model.ts +40 -0
  104. package/src/models/index.ts +7 -0
  105. package/src/openapi-spec.ts +28 -0
  106. package/src/repositories/account.repository.ts +19 -0
  107. package/src/repositories/customer.repository.ts +42 -0
  108. package/src/repositories/index.ts +7 -0
  109. package/src/sequence.ts +8 -0
  110. package/tsconfig.json +39 -0
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ // Copyright IBM Corp. and LoopBack contributors 2019,2020. All Rights Reserved.
3
+ // Node module: @loopback/example-references-many
4
+ // This file is licensed under the MIT License.
5
+ // License text available at https://opensource.org/licenses/MIT
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.testdb = exports.givenEmptyDatabase = exports.givenAccountInstance = exports.givenCustomerInstance = exports.givenAccountRepositories = exports.givenCustomerRepositories = exports.givenRunningApplicationWithCustomConfiguration = exports.givenAccount = exports.givenCustomer = void 0;
8
+ const repository_1 = require("@loopback/repository");
9
+ const testlab_1 = require("@loopback/testlab");
10
+ const application_1 = require("../application");
11
+ const models_1 = require("../models");
12
+ const repositories_1 = require("../repositories");
13
+ /*
14
+ ==============================================================================
15
+ HELPER FUNCTIONS
16
+ If you find yourself creating the same helper functions across different
17
+ test files, then extracting those functions into helper modules is an easy
18
+ way to reduce duplication.
19
+
20
+ Other tips:
21
+
22
+ - Using the super awesome Partial<T> type in conjunction with Object.assign
23
+ means you can:
24
+ * customize the object you get back based only on what's important
25
+ to you during a particular test
26
+ * avoid writing test logic that is brittle with respect to the properties
27
+ of your object
28
+ - Making the input itself optional means you don't need to do anything special
29
+ for tests where the particular details of the input don't matter.
30
+ ==============================================================================
31
+ */
32
+ /**
33
+ * Generate a complete Customer object for use with tests.
34
+ * @param customer - A partial (or complete) Customer object.
35
+ */
36
+ function givenCustomer(customer) {
37
+ const data = Object.assign({
38
+ firstName: 'John',
39
+ lastName: 'Doe',
40
+ }, customer);
41
+ return new models_1.Customer(data);
42
+ }
43
+ exports.givenCustomer = givenCustomer;
44
+ /**
45
+ * Generate a complete Account object for use with tests.
46
+ * @param account - A partial (or complete) Account object.
47
+ */
48
+ function givenAccount(account) {
49
+ const data = Object.assign({ balance: 999 }, account);
50
+ return new models_1.Account(data);
51
+ }
52
+ exports.givenAccount = givenAccount;
53
+ async function givenRunningApplicationWithCustomConfiguration() {
54
+ const app = new application_1.ReferencesManyApplication({
55
+ rest: (0, testlab_1.givenHttpServerConfig)(),
56
+ });
57
+ await app.boot();
58
+ /**
59
+ * Override default config for DataSource for testing so we don't write
60
+ * test data to file when using the memory connector.
61
+ */
62
+ app.bind('datasources.config.db').to({
63
+ name: 'db',
64
+ connector: 'memory',
65
+ });
66
+ // Start Application
67
+ await app.start();
68
+ return app;
69
+ }
70
+ exports.givenRunningApplicationWithCustomConfiguration = givenRunningApplicationWithCustomConfiguration;
71
+ async function givenCustomerRepositories(app) {
72
+ const customerRepo = await app.getRepository(repositories_1.CustomerRepository);
73
+ const accountRepo = await app.getRepository(repositories_1.AccountRepository);
74
+ return { customerRepo, accountRepo };
75
+ }
76
+ exports.givenCustomerRepositories = givenCustomerRepositories;
77
+ async function givenAccountRepositories(app) {
78
+ const accountRepo = await app.getRepository(repositories_1.AccountRepository);
79
+ return { accountRepo };
80
+ }
81
+ exports.givenAccountRepositories = givenAccountRepositories;
82
+ async function givenCustomerInstance(customerRepo, customer) {
83
+ return customerRepo.create(givenCustomer(customer));
84
+ }
85
+ exports.givenCustomerInstance = givenCustomerInstance;
86
+ async function givenAccountInstance(accountRepo, account) {
87
+ return accountRepo.create(givenAccount(account));
88
+ }
89
+ exports.givenAccountInstance = givenAccountInstance;
90
+ async function givenEmptyDatabase() {
91
+ const accountRepo = new repositories_1.AccountRepository(exports.testdb);
92
+ const customerRepo = new repositories_1.CustomerRepository(exports.testdb, async () => accountRepo, async () => customerRepo);
93
+ await accountRepo.deleteAll();
94
+ await customerRepo.deleteAll();
95
+ }
96
+ exports.givenEmptyDatabase = givenEmptyDatabase;
97
+ exports.testdb = new repository_1.juggler.DataSource({
98
+ name: 'db',
99
+ connector: 'memory',
100
+ });
101
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/__tests__/helpers.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,iDAAiD;AACjD,+CAA+C;AAC/C,gEAAgE;;;AAEhE,qDAA6C;AAC7C,+CAAwD;AACxD,gDAAyD;AACzD,sCAA4C;AAC5C,kDAAsE;AAEtE;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;GAGG;AACH,SAAgB,aAAa,CAAC,QAA4B;IACxD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CACxB;QACE,SAAS,EAAE,MAAM;QACjB,QAAQ,EAAE,KAAK;KAChB,EACD,QA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5B,OAAO,YAAY,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC;AALD,sDAKC;AAEM,KAAK,UAAU,oBAAoB,CACxC,WAA8B,EAC9B,OAA0B;IAE1B,OAAO,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AACnD,CAAC;AALD,oDAKC;AAEM,KAAK,UAAU,kBAAkB;IACtC,MAAM,WAAW,GAAsB,IAAI,gCAAiB,CAAC,cAAM,CAAC,CAAC;IACrE,MAAM,YAAY,GAAuB,IAAI,iCAAkB,CAC7D,cAAM,EACN,KAAK,IAAI,EAAE,CAAC,WAAW,EACvB,KAAK,IAAI,EAAE,CAAC,YAAY,CACzB,CAAC;IAEF,MAAM,WAAW,CAAC,SAAS,EAAE,CAAC;IAC9B,MAAM,YAAY,CAAC,SAAS,EAAE,CAAC;AACjC,CAAC;AAVD,gDAUC;AAEY,QAAA,MAAM,GAAuB,IAAI,oBAAO,CAAC,UAAU,CAAC;IAC/D,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,QAAQ;CACpB,CAAC,CAAC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ // Copyright IBM Corp. and LoopBack contributors 2019,2020. All Rights Reserved.
3
+ // Node module: @loopback/example-references-many
4
+ // This file is licensed under the MIT License.
5
+ // License text available at https://opensource.org/licenses/MIT
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const testlab_1 = require("@loopback/testlab");
8
+ const repositories_1 = require("../../repositories");
9
+ const helpers_1 = require("../helpers");
10
+ describe('ReferencesManyRepository', () => {
11
+ let accountRepo;
12
+ let customerRepo;
13
+ before(async () => {
14
+ accountRepo = new repositories_1.AccountRepository(helpers_1.testdb);
15
+ customerRepo = new repositories_1.CustomerRepository(helpers_1.testdb, async () => accountRepo, async () => customerRepo);
16
+ });
17
+ beforeEach(helpers_1.givenEmptyDatabase);
18
+ it('includes Accounts in find method result', async () => {
19
+ const account = await (0, helpers_1.givenAccountInstance)(accountRepo);
20
+ const customer = await (0, helpers_1.givenCustomerInstance)(customerRepo, {
21
+ accountIds: [account.id],
22
+ });
23
+ const response = await customerRepo.find({
24
+ include: ['accounts'],
25
+ });
26
+ (0, testlab_1.expect)((0, testlab_1.toJSON)(response)).to.deepEqual([
27
+ {
28
+ ...(0, testlab_1.toJSON)(customer),
29
+ accounts: [(0, testlab_1.toJSON)(account)],
30
+ },
31
+ ]);
32
+ });
33
+ it('includes Accounts in findById result', async () => {
34
+ const account = await (0, helpers_1.givenAccountInstance)(accountRepo);
35
+ const customer = await (0, helpers_1.givenCustomerInstance)(customerRepo, {
36
+ accountIds: [account.id],
37
+ });
38
+ const response = await customerRepo.findById(customer.id, {
39
+ include: ['accounts'],
40
+ });
41
+ (0, testlab_1.expect)((0, testlab_1.toJSON)(response)).to.deepEqual({
42
+ ...(0, testlab_1.toJSON)(customer),
43
+ accounts: [(0, testlab_1.toJSON)(account)],
44
+ });
45
+ });
46
+ it('includes Accounts in findOne method result', async () => {
47
+ const account = await (0, helpers_1.givenAccountInstance)(accountRepo);
48
+ const customer = await (0, helpers_1.givenCustomerInstance)(customerRepo, {
49
+ accountIds: [account.id],
50
+ });
51
+ const response = await customerRepo.findOne({
52
+ where: { id: customer.id },
53
+ include: ['accounts'],
54
+ });
55
+ (0, testlab_1.expect)((0, testlab_1.toJSON)(response)).to.deepEqual({
56
+ ...(0, testlab_1.toJSON)(customer),
57
+ accounts: [(0, testlab_1.toJSON)(account)],
58
+ });
59
+ });
60
+ });
61
+ //# sourceMappingURL=customer.repository.integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer.repository.integration.js","sourceRoot":"","sources":["../../../src/__tests__/integration/customer.repository.integration.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,iDAAiD;AACjD,+CAA+C;AAC/C,gEAAgE;;AAEhE,+CAAiD;AACjD,qDAAyE;AACzE,wCAKoB;AAEpB,QAAQ,CAAC,0BAA0B,EA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Q,GAAG,MAAM,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE;YACxD,OAAO,EAAE,CAAC,UAAU,CAAC;SACtB,CAAC,CAAC;QAEH,IAAA,gBAAM,EAAC,IAAA,gBAAM,EAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC;YACpC,GAAG,IAAA,gBAAM,EAAC,QAAQ,CAAC;YACnB,QAAQ,EAAE,CAAC,IAAA,gBAAM,EAAC,OAAO,CAAC,CAAC;SAC5B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,KAAK,IAAI,EAAE;QAC1D,MAAM,OAAO,GAAG,MAAM,IAAA,8BAAoB,EAAC,WAAW,CAAC,CAAC;QACxD,MAAM,QAAQ,GAAG,MAAM,IAAA,+BAAqB,EAAC,YAAY,EAAE;YACzD,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;SACzB,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAC;YACxB,OAAO,EAAE,CAAC,UAAU,CAAC;SACtB,CAAC,CAAC;QAEH,IAAA,gBAAM,EAAC,IAAA,gBAAM,EAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC;YACpC,GAAG,IAAA,gBAAM,EAAC,QAAQ,CAAC;YACnB,QAAQ,EAAE,CAAC,IAAA,gBAAM,EAAC,OAAO,CAAC,CAAC;SAC5B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ // Copyright IBM Corp. and LoopBack contributors 2019,2020. All Rights Reserved.
3
+ // Node module: @loopback/example-account-list
4
+ // This file is licensed under the MIT License.
5
+ // License text available at https://opensource.org/licenses/MIT
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const testlab_1 = require("@loopback/testlab");
8
+ const controllers_1 = require("../../../controllers");
9
+ const repositories_1 = require("../../../repositories");
10
+ const helpers_1 = require("../../helpers");
11
+ describe('AccountController', () => {
12
+ let accountRepo;
13
+ /*
14
+ =============================================================================
15
+ TEST VARIABLES
16
+ Combining top-level objects with our resetRepositories method means we don't
17
+ need to duplicate several variable assignments (and generation statements)
18
+ in all of our test logic.
19
+
20
+ NOTE: If you wanted to parallelize your test runs, you should avoid this
21
+ pattern since each of these tests is sharing references.
22
+ =============================================================================
23
+ */
24
+ let controller;
25
+ let aAccount;
26
+ let aAccountWithId;
27
+ let aChangedAccount;
28
+ let aListOfAccounts;
29
+ beforeEach(resetRepositories);
30
+ describe('createAccount', () => {
31
+ it('creates a Account', async () => {
32
+ const create = accountRepo.stubs.create;
33
+ create.resolves(aAccountWithId);
34
+ const result = await controller.create(aAccount);
35
+ (0, testlab_1.expect)(result).to.eql(aAccountWithId);
36
+ testlab_1.sinon.assert.calledWith(create, aAccount);
37
+ });
38
+ });
39
+ describe('findAccountById', () => {
40
+ it('returns a account if it exists', async () => {
41
+ const findById = accountRepo.stubs.findById;
42
+ findById.resolves(aAccountWithId);
43
+ (0, testlab_1.expect)(await controller.findById(aAccountWithId.id)).to.eql(aAccountWithId);
44
+ testlab_1.sinon.assert.calledWith(findById, aAccountWithId.id);
45
+ });
46
+ });
47
+ describe('findAccounts', () => {
48
+ it('returns multiple accounts if they exist', async () => {
49
+ const find = accountRepo.stubs.find;
50
+ find.resolves(aListOfAccounts);
51
+ (0, testlab_1.expect)(await controller.find()).to.eql(aListOfAccounts);
52
+ testlab_1.sinon.assert.called(find);
53
+ });
54
+ it('returns empty list if no accounts exist', async () => {
55
+ const find = accountRepo.stubs.find;
56
+ const expected = [];
57
+ find.resolves(expected);
58
+ (0, testlab_1.expect)(await controller.find()).to.eql(expected);
59
+ testlab_1.sinon.assert.called(find);
60
+ });
61
+ });
62
+ describe('replaceAccount', () => {
63
+ it('successfully replaces existing items', async () => {
64
+ const replaceById = accountRepo.stubs.replaceById;
65
+ replaceById.resolves();
66
+ await controller.replaceById(aAccountWithId.id, aChangedAccount);
67
+ testlab_1.sinon.assert.calledWith(replaceById, aAccountWithId.id, aChangedAccount);
68
+ });
69
+ });
70
+ describe('updateAccount', () => {
71
+ it('successfully updates existing items', async () => {
72
+ const updateById = accountRepo.stubs.updateById;
73
+ updateById.resolves();
74
+ await controller.updateById(aAccountWithId.id, aChangedAccount);
75
+ testlab_1.sinon.assert.calledWith(updateById, aAccountWithId.id, aChangedAccount);
76
+ });
77
+ });
78
+ describe('deleteAccount', () => {
79
+ it('successfully deletes existing items', async () => {
80
+ const deleteById = accountRepo.stubs.deleteById;
81
+ deleteById.resolves();
82
+ await controller.deleteById(aAccountWithId.id);
83
+ testlab_1.sinon.assert.calledWith(deleteById, aAccountWithId.id);
84
+ });
85
+ });
86
+ function resetRepositories() {
87
+ accountRepo = (0, testlab_1.createStubInstance)(repositories_1.AccountRepository);
88
+ aAccount = (0, helpers_1.givenAccount)();
89
+ aAccountWithId = (0, helpers_1.givenAccount)({
90
+ id: 1,
91
+ });
92
+ aListOfAccounts = [
93
+ aAccountWithId,
94
+ (0, helpers_1.givenAccount)({
95
+ id: 2,
96
+ balance: 5,
97
+ }),
98
+ ];
99
+ aChangedAccount = (0, helpers_1.givenAccount)({
100
+ id: aAccountWithId.id,
101
+ balance: 10,
102
+ });
103
+ controller = new controllers_1.AccountController(accountRepo);
104
+ }
105
+ });
106
+ //# sourceMappingURL=account.controller.unit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.controller.unit.js","sourceRoot":"","sources":["../../../../src/__tests__/unit/controllers/account.controller.unit.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,8CAA8C;AAC9C,+CAA+C;AAC/C,gEAAgE;;AAEhE,+CAK2B;AAC3B,sDAAuD;AAEvD,wDAAwD;AACxD,2CAA2C;AAE3C,QAAQ,CAAC,mBAAmB,EAAE,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IAAI,+BAAiB,CAAC,WAAW,CAAC,CAAC;IAClD,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ // Copyright IBM Corp. and LoopBack contributors 2019,2020. All Rights Reserved.
3
+ // Node module: @loopback/example-customer-list
4
+ // This file is licensed under the MIT License.
5
+ // License text available at https://opensource.org/licenses/MIT
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const testlab_1 = require("@loopback/testlab");
8
+ const controllers_1 = require("../../../controllers");
9
+ const repositories_1 = require("../../../repositories");
10
+ const helpers_1 = require("../../helpers");
11
+ describe('CustomerController', () => {
12
+ let customerRepo;
13
+ /*
14
+ =============================================================================
15
+ TEST VARIABLES
16
+ Combining top-level objects with our resetRepositories method means we don't
17
+ need to duplicate several variable assignments (and generation statements)
18
+ in all of our test logic.
19
+
20
+ NOTE: If you wanted to parallelize your test runs, you should avoid this
21
+ pattern since each of these tests is sharing references.
22
+ =============================================================================
23
+ */
24
+ let controller;
25
+ let aCustomer;
26
+ let aCustomerWithId;
27
+ let aChangedCustomer;
28
+ let aListOfCustomers;
29
+ beforeEach(resetRepositories);
30
+ describe('createCustomer', () => {
31
+ it('creates a Customer', async () => {
32
+ const create = customerRepo.stubs.create;
33
+ create.resolves(aCustomerWithId);
34
+ const result = await controller.create(aCustomer);
35
+ (0, testlab_1.expect)(result).to.eql(aCustomerWithId);
36
+ testlab_1.sinon.assert.calledWith(create, aCustomer);
37
+ });
38
+ });
39
+ describe('findCustomerById', () => {
40
+ it('returns a customer if it exists', async () => {
41
+ const findById = customerRepo.stubs.findById;
42
+ findById.resolves(aCustomerWithId);
43
+ (0, testlab_1.expect)(await controller.findById(aCustomerWithId.id)).to.eql(aCustomerWithId);
44
+ testlab_1.sinon.assert.calledWith(findById, aCustomerWithId.id);
45
+ });
46
+ });
47
+ describe('findCustomers', () => {
48
+ it('returns multiple customers if they exist', async () => {
49
+ const find = customerRepo.stubs.find;
50
+ find.resolves(aListOfCustomers);
51
+ (0, testlab_1.expect)(await controller.find()).to.eql(aListOfCustomers);
52
+ testlab_1.sinon.assert.called(find);
53
+ });
54
+ it('returns empty list if no customers exist', async () => {
55
+ const find = customerRepo.stubs.find;
56
+ const expected = [];
57
+ find.resolves(expected);
58
+ (0, testlab_1.expect)(await controller.find()).to.eql(expected);
59
+ testlab_1.sinon.assert.called(find);
60
+ });
61
+ });
62
+ describe('replaceCustomer', () => {
63
+ it('successfully replaces existing items', async () => {
64
+ const replaceById = customerRepo.stubs.replaceById;
65
+ replaceById.resolves();
66
+ await controller.replaceById(aCustomerWithId.id, aChangedCustomer);
67
+ testlab_1.sinon.assert.calledWith(replaceById, aCustomerWithId.id, aChangedCustomer);
68
+ });
69
+ });
70
+ describe('updateCustomer', () => {
71
+ it('successfully updates existing items', async () => {
72
+ const updateById = customerRepo.stubs.updateById;
73
+ updateById.resolves();
74
+ await controller.updateById(aCustomerWithId.id, aChangedCustomer);
75
+ testlab_1.sinon.assert.calledWith(updateById, aCustomerWithId.id, aChangedCustomer);
76
+ });
77
+ });
78
+ describe('deleteCustomer', () => {
79
+ it('successfully deletes existing items', async () => {
80
+ const deleteById = customerRepo.stubs.deleteById;
81
+ deleteById.resolves();
82
+ await controller.deleteById(aCustomerWithId.id);
83
+ testlab_1.sinon.assert.calledWith(deleteById, aCustomerWithId.id);
84
+ });
85
+ });
86
+ function resetRepositories() {
87
+ customerRepo = (0, testlab_1.createStubInstance)(repositories_1.CustomerRepository);
88
+ aCustomer = (0, helpers_1.givenCustomer)();
89
+ aCustomerWithId = (0, helpers_1.givenCustomer)({
90
+ id: 1,
91
+ });
92
+ aListOfCustomers = [
93
+ aCustomerWithId,
94
+ (0, helpers_1.givenCustomer)({
95
+ id: 2,
96
+ firstName: 'Dave',
97
+ lastName: 'Brubeck',
98
+ }),
99
+ ];
100
+ aChangedCustomer = (0, helpers_1.givenCustomer)({
101
+ id: aCustomerWithId.id,
102
+ firstName: 'Tim',
103
+ lastName: 'Benton',
104
+ });
105
+ controller = new controllers_1.CustomerController(customerRepo);
106
+ }
107
+ });
108
+ //# sourceMappingURL=customer.controller.unit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer.controller.unit.js","sourceRoot":"","sources":["../../../../src/__tests__/unit/controllers/customer.controller.unit.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,+CAA+C;AAC/C,gEAAgE;;AAEhE,+CAK2B;AAC3B,sDAAwD;AAExD,wDAAyD;AACzD,2CAA4C;AAE5C,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,IAAI,YAAkE,CAAC;IAEvE;;;;;;;;;;MAUE;IACF,IAAI,UAA8B,CAAC;IACnC,IAAI,SAAmB,CAAC;IACxB,IAAI,eAAyB,CAAC;IAC9B,IAAI,gBAA0B,CAAC;IAC/B,IAAI,gBAA4B,CAAC;IAEjC,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAE9B,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;QAC9B,EAAE,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;YAClC,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC;YACzC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;YACjC,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAClD,IAAA,gBAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;YACvC,eAAK,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAChC,EAAE,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;YAC/C,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC;YAC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