Commit eff4eadb authored by Robert Knight's avatar Robert Knight

Group tests in `describe` blocks labeled with the function name

For easier debugging when tests fail, ensure that `it` cases that refer
to specific functions in a module are grouped under a `describe` block
labeled with the function's name.
parent 499a3419
......@@ -11,18 +11,22 @@ describe('sidebar/store/modules/direct-linked', () => {
store = createStore([directLinked], [fakeSettings]);
});
it('sets directLinkedGroupFetchFailed to true', () => {
store.setDirectLinkedGroupFetchFailed();
describe('setDirectLinkedGroupFetchFailed', () => {
it('sets directLinkedGroupFetchFailed to true', () => {
store.setDirectLinkedGroupFetchFailed();
assert.isTrue(store.getState().directLinkedGroupFetchFailed);
assert.isTrue(store.getState().directLinkedGroupFetchFailed);
});
});
it('sets directLinkedGroupFetchFailed to false', () => {
store.setDirectLinkedGroupFetchFailed();
describe('clearDirectLinkedGroupFetchFailed', () => {
it('sets directLinkedGroupFetchFailed to false', () => {
store.setDirectLinkedGroupFetchFailed();
store.clearDirectLinkedGroupFetchFailed();
store.clearDirectLinkedGroupFetchFailed();
assert.isFalse(store.getState().directLinkedGroupFetchFailed);
assert.isFalse(store.getState().directLinkedGroupFetchFailed);
});
});
it('sets directLinkedAnnotationId to settings.annotations during store init', () => {
......@@ -33,10 +37,12 @@ describe('sidebar/store/modules/direct-linked', () => {
assert.equal(store.getState().directLinkedAnnotationId, 'ann-id');
});
it('sets directLinkedAnnotationId to the specified annotation id', () => {
store.setDirectLinkedAnnotationId('ann-id');
describe('setDirectLinkedAnnotationId', () => {
it('sets directLinkedAnnotationId to the specified annotation id', () => {
store.setDirectLinkedAnnotationId('ann-id');
assert.equal(store.getState().directLinkedAnnotationId, 'ann-id');
assert.equal(store.getState().directLinkedAnnotationId, 'ann-id');
});
});
it('sets directLinkedGroupId to settings.group during store init', () => {
......@@ -47,19 +53,23 @@ describe('sidebar/store/modules/direct-linked', () => {
assert.equal(store.getState().directLinkedGroupId, 'group-id');
});
it('sets directLinkedGroupId to the specified group id', () => {
store.setDirectLinkedGroupId('group-id');
describe('setDirectLinkedGroupId', () => {
it('sets directLinkedGroupId to the specified group id', () => {
store.setDirectLinkedGroupId('group-id');
assert.equal(store.getState().directLinkedGroupId, 'group-id');
assert.equal(store.getState().directLinkedGroupId, 'group-id');
});
});
it('sets direct-link annotations and group ids to null', () => {
store.setDirectLinkedGroupId('ann-id');
store.setDirectLinkedGroupId('group-id');
describe('clearDirectLinkedIds', () => {
it('sets direct-link annotations and group ids to null', () => {
store.setDirectLinkedGroupId('ann-id');
store.setDirectLinkedGroupId('group-id');
store.clearDirectLinkedIds();
store.clearDirectLinkedIds();
assert.equal(store.getState().directLinkedAnnotationId, null);
assert.equal(store.getState().directLinkedGroupId, null);
assert.equal(store.getState().directLinkedAnnotationId, null);
assert.equal(store.getState().directLinkedGroupId, null);
});
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment