Skip to content

Commit

Permalink
UI: fix export button tests (#27945)
Browse files Browse the repository at this point in the history
  • Loading branch information
hashishaw authored Aug 1, 2024
1 parent 2d1f692 commit 68a5741
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
12 changes: 3 additions & 9 deletions ui/tests/integration/components/clients/export-button-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ module('Integration | Component | clients/export-button', function (hooks) {
const namespaceSvc = this.owner.lookup('service:namespace');
namespaceSvc.path = 'foo';
this.server.get('/sys/internal/counters/activity/export', function (_, req) {
assert.deepEqual(req.requestHeaders, {
'X-Vault-Namespace': 'foo',
});
assert.strictEqual(req.requestHeaders['X-Vault-Namespace'], 'foo');
return new Response(200, { 'Content-Type': 'text/csv' }, '');
});

Expand All @@ -133,9 +131,7 @@ module('Integration | Component | clients/export-button', function (hooks) {
test('it sends the selected namespace in export request', async function (assert) {
assert.expect(2);
this.server.get('/sys/internal/counters/activity/export', function (_, req) {
assert.deepEqual(req.requestHeaders, {
'X-Vault-Namespace': 'foobar',
});
assert.strictEqual(req.requestHeaders['X-Vault-Namespace'], 'foobar');
return new Response(200, { 'Content-Type': 'text/csv' }, '');
});
this.selectedNamespace = 'foobar/';
Expand All @@ -157,9 +153,7 @@ module('Integration | Component | clients/export-button', function (hooks) {
const namespaceSvc = this.owner.lookup('service:namespace');
namespaceSvc.path = 'foo';
this.server.get('/sys/internal/counters/activity/export', function (_, req) {
assert.deepEqual(req.requestHeaders, {
'X-Vault-Namespace': 'foo/bar',
});
assert.strictEqual(req.requestHeaders['X-Vault-Namespace'], 'foo/bar');
return new Response(200, { 'Content-Type': 'text/csv' }, '');
});
this.selectedNamespace = 'bar/';
Expand Down
2 changes: 1 addition & 1 deletion ui/tests/unit/adapters/clients-activity-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ module('Unit | Adapter | clients activity', function (hooks) {
assert.expect(2);

this.server.get('sys/internal/counters/activity/export', (schema, req) => {
assert.propEqual(req.requestHeaders, { 'X-Vault-Namespace': 'foo/bar' });
assert.strictEqual(req.requestHeaders['X-Vault-Namespace'], 'foo/bar');
assert.propEqual(req.queryParams, {
format: 'json',
start_time: '2024-04-01T00:00:00.000Z',
Expand Down

0 comments on commit 68a5741

Please sign in to comment.