Skip to content

Commit 6ce5a77

Browse files
asibrossjoshiste
authored andcommitted
Fix flaky sba-time-ago test
Using moment(Number) method creates a moment in the machines local time zone. This causes the "given a long time passed time" test to fail when running in PST, as it would resolve to Jul 6 and not Jul 7 like the snapshot.
1 parent 1cc0586 commit 6ce5a77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-boot-admin-server-ui/src/main/frontend/components/sba-time-ago.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('time-ago', () => {
2626
it('should match the snapshot', () => {
2727
const wrapper = shallowMount(sbaTimeAgo, {
2828
propsData: {
29-
date: moment(1318781000000)
29+
date: moment(1318781000000).utc()
3030
}
3131
});
3232
expect(wrapper.vm.$el).toMatchSnapshot();
@@ -37,7 +37,7 @@ describe('time-ago', () => {
3737
it('should match the snapshot', () => {
3838
const wrapper = shallowMount(sbaTimeAgo, {
3939
propsData: {
40-
date: moment(1310000000000)
40+
date: moment(1310000000000).utc()
4141
}
4242
});
4343
expect(wrapper.vm.$el).toMatchSnapshot();

0 commit comments

Comments
 (0)