Skip to content
Snippets Groups Projects
Commit 63a4daa5 authored by Phil Hughes's avatar Phil Hughes
Browse files

Fixed failing teaspoon tests

parent 3f769e78
No related branches found
No related tags found
No related merge requests found
class Issue {
class ListIssue {
constructor (obj) {
this.id = obj.iid;
this.title = obj.title;
this.confidential = obj.confidential;
 
if (obj.assignee) {
this.assignee = new User(obj.assignee);
this.assignee = new ListUser(obj.assignee);
}
 
this.labels = [];
 
_.each(obj.labels, (label) => {
this.labels.push(new Label(label));
this.labels.push(new ListLabel(label));
});
 
this.priority = _.reduce(this.labels, (max, label) => {
Loading
Loading
@@ -24,7 +24,7 @@ class Issue {
const hasLabel = this.findLabel(label);
 
if (!hasLabel) {
this.labels.push(new Label(label));
this.labels.push(new ListLabel(label));
}
}
}
Loading
Loading
class Label {
class ListLabel {
constructor (obj) {
this.id = obj.id;
this.title = obj.title;
Loading
Loading
Loading
Loading
@@ -10,7 +10,7 @@ class List {
this.issues = [];
 
if (obj.label) {
this.label = new Label(obj.label);
this.label = new ListLabel(obj.label);
}
 
if (this.type !== 'blank' && this.id) {
Loading
Loading
@@ -85,8 +85,8 @@ class List {
}
 
createIssues (data) {
_.each(data, (issue) => {
this.issues.push(new Issue(issue));
_.each(data, (issueObj) => {
this.issues.push(new ListIssue(issueObj));
});
}
 
Loading
Loading
class User {
class ListUser {
constructor (user) {
this.id = user.id;
this.name = user.name;
Loading
Loading
Loading
Loading
@@ -54,6 +54,7 @@
 
setTimeout(() => {
expect(list.issues.length).toBe(1);
expect(list.issues[0].id).toBe(1);
done();
}, 0);
});
Loading
Loading
@@ -135,10 +136,10 @@
 
expect(BoardsStore.state.lists.length).toBe(2);
 
setTimeout(() => {
const list = BoardsStore.findList('id', 1);
const listTwo = BoardsStore.findList('id', 2);
const list = BoardsStore.findList('id', 1),
listTwo = BoardsStore.findList('id', 2);
 
setTimeout(() => {
expect(list.issues.length).toBe(1);
expect(listTwo.issues.length).toBe(1);
 
Loading
Loading
@@ -148,7 +149,7 @@
expect(listTwo.issues.length).toBe(1);
 
done();
});
}, 0);
});
});
});
Loading
Loading
Loading
Loading
@@ -19,7 +19,7 @@ describe('Issue model', () => {
gl.boardService = new BoardService('/test/issue-boards/board');
BoardsStore.create();
 
issue = new Issue({
issue = new ListIssue({
title: 'Testing',
iid: 1,
confidential: false,
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