Skip to content
Snippets Groups Projects
Unverified Commit 7b507e87 authored by Martin Wortschack's avatar Martin Wortschack Committed by Steve Azzopardi
Browse files

Fix broken karma test

parent 3271fb36
No related branches found
No related tags found
No related merge requests found
---
title: Fix due date test
merge_request: 23845
author:
type: other
Loading
Loading
@@ -49,10 +49,11 @@ describe('Issue Due Date component', () => {
it('should render month and day for other dates', () => {
date.setDate(date.getDate() + 17);
vm = createComponent(date);
const today = new Date();
const isDueInCurrentYear = today.getFullYear() === date.getFullYear();
const format = isDueInCurrentYear ? 'mmm d' : 'mmm d, yyyy';
 
expect(vm.$el.querySelector('time').textContent.trim()).toEqual(
dateFormat(date, 'mmm d', true),
);
expect(vm.$el.querySelector('time').textContent.trim()).toEqual(dateFormat(date, format, true));
});
 
it('should contain the correct `.text-danger` css class for overdue issue', () => {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment