Files
threshold-ui/addons/api/tests/unit/adapters/storage-bucket-test.js
T
Zhihe Li bcf004b8a4 Reformat codebase with trailing commas in functions (#2006)
* style: 💄 Update trailing commas in API

* style: 💄 Update trailing commas in core

* style: 💄 Update trailing commas in rose

* style: 💄 Update trailing commas in admin

* style: 💄 Update trailing commas in desktop
2023-11-22 14:07:41 -05:00

36 lines
869 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Adapter | storage bucket', function (hooks) {
setupTest(hooks);
test('it generates correct createRecord URLs for storage buckets with extra query parameter ?plugin_name', function (assert) {
assert.expect(1);
const scopeID = 'o_1';
const mockSnapshot = {
adapterOptions: {
scopeID,
},
attr() {
return { name: 'aws_s3' };
},
};
const adapter = this.owner.lookup('adapter:storage-bucket');
const createRecordURL = adapter.buildURL(
'storage-bucket',
null,
mockSnapshot,
'createRecord',
);
assert.strictEqual(
createRecordURL,
'/v1/storage-buckets?plugin_name=aws_s3',
);
});
});