-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
713eaca
commit 7d65ad0
Showing
15 changed files
with
89 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
describe('bridge', () => { | ||
it('can create bridge', () => { | ||
expect(new mumuki.bridge.Laboratory()).not.toBe(null); | ||
}) | ||
}) | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
describe('csrf token', () => { | ||
it('can create token', () => { | ||
expect(new mumuki.CsrfToken()).not.toBe(null); | ||
}) | ||
}) | ||
}); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,40 @@ | ||
describe('exercise', () => { | ||
|
||
it('current exercise information is available when present', () => { | ||
$('body').html(` | ||
<input type="hidden" name="mu-exercise-id" id="mu-exercise-id" value="3361" /> | ||
<input type="hidden" name="mu-exercise-layout" id="mu-exercise-layout" value="input_right" /> | ||
<input type="hidden" name="mu-exercise-settings" id="mu-exercise-settings" value="{}" />`) | ||
<input type="hidden" name="mu-exercise-settings" id="mu-exercise-settings" value="{}" />`); | ||
|
||
mumuki.exercise.load(); | ||
|
||
expect(mumuki.exercise.id).toBe(3361); | ||
expect(mumuki.exercise.layout).toBe('input_right'); | ||
expect(mumuki.exercise.settings).toEqual({}); | ||
expect(mumuki.exercise.current).not.toBe(null); | ||
}) | ||
}); | ||
|
||
it('current exercise information is available when present and settings are not empty', () => { | ||
$('body').html(` | ||
<input type="hidden" name="mu-exercise-id" id="mu-exercise-id" value="3361" /> | ||
<input type="hidden" name="mu-exercise-layout" id="mu-exercise-layout" value="input_right" /> | ||
<input type="hidden" name="mu-exercise-settings" id="mu-exercise-settings" value="{"game_framework":true}" />`) | ||
<input type="hidden" name="mu-exercise-settings" id="mu-exercise-settings" value="{"game_framework":true}" />`); | ||
|
||
mumuki.exercise.load(); | ||
|
||
expect(mumuki.exercise.id).toBe(3361); | ||
expect(mumuki.exercise.layout).toBe('input_right'); | ||
expect(mumuki.exercise.settings.game_framework).toBe(true); | ||
expect(mumuki.exercise.current).not.toBe(null); | ||
}) | ||
}); | ||
|
||
it('current exercise information is available when not present', () => { | ||
$('body').html(``) | ||
$('body').html(``); | ||
|
||
mumuki.exercise.load(); | ||
|
||
expect(mumuki.exercise.id).toBe(null); | ||
expect(mumuki.exercise.layout).toBe(null); | ||
expect(mumuki.exercise.settings).toBe(null); | ||
expect(mumuki.exercise.current).toBe(null); | ||
}) | ||
}) | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
describe("global loading", () => { | ||
it("produces no global loading errors", () => { | ||
const error = window['__globalLoadingError__']; | ||
expect(!error).toBe(true, `Expected no global loading errors but got ${error && error.message}`) | ||
}) | ||
}) | ||
expect(!error).toBe(true, `Expected no global loading errors but got ${error && error.message}`); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
describe('results renderers', () => { | ||
it('can compute class for status', () => { | ||
expect(mumuki.renderers.classForStatus('passed')).toEqual('success'); | ||
}) | ||
}); | ||
|
||
it('can compute icon for status', () => { | ||
expect(mumuki.renderers.iconForStatus('pending')).toEqual('fa-circle'); | ||
}) | ||
}); | ||
|
||
it('can compute progress list item for status', () => { | ||
expect(mumuki.renderers.progressListItemClassForStatus('passed_with_warnings')).toEqual('progress-list-item text-center warning '); | ||
}) | ||
}); | ||
|
||
it('can compute progress list item for status when active', () => { | ||
expect(mumuki.renderers.progressListItemClassForStatus('failed', true)).toEqual('progress-list-item text-center danger active'); | ||
}) | ||
}) | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,5 @@ describe('results renderers', () => { | |
<li>fix that</li> | ||
</ul> | ||
</div>`); | ||
}) | ||
|
||
}) | ||
}); | ||
}); |
Oops, something went wrong.