vault/ui/tests/unit/utils/timestamp-test.js
Vault Automation 0c6c13dd38
license: update headers to IBM Corp. (#10229) (#10233)
* license: update headers to IBM Corp.
* `make proto`
* update offset because source file changed

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-10-21 15:20:20 -06:00

20 lines
608 B
JavaScript

/**
* Copyright IBM Corp. 2016, 2025
* SPDX-License-Identifier: BUSL-1.1
*/
import timestamp from 'core/utils/timestamp';
import sinon from 'sinon';
import { module, test } from 'qunit';
/*
This test coverage is more for an example than actually covering the utility
*/
module('Unit | Utility | timestamp', function () {
test('it can be overridden', function (assert) {
sinon.replace(timestamp, 'now', sinon.fake.returns(new Date('2030-03-03T03:30:03')));
const result = timestamp.now();
assert.strictEqual(result.toISOString(), new Date('2030-03-03T03:30:03').toISOString());
});
});