Commit 4f7c7b15 authored by Dave Pisek's avatar Dave Pisek

Reviewer feedback: Test description fixes

parent b45accce
...@@ -194,7 +194,9 @@ describe('Project Licenses', () => { ...@@ -194,7 +194,9 @@ describe('Project Licenses', () => {
${'policies'} | ${1} ${'policies'} | ${1}
${'foo'} | ${0} ${'foo'} | ${0}
${'bar'} | ${0} ${'bar'} | ${0}
`('when the url contains $givenUrlHash hash', ({ givenLocationHash, expectedTabIndex }) => { `(
'when the url contains $givenLocationHash hash',
({ givenLocationHash, expectedTabIndex }) => {
beforeEach(() => { beforeEach(() => {
setWindowLocation({ setWindowLocation({
href: `${TEST_HOST}#${givenLocationHash}`, href: `${TEST_HOST}#${givenLocationHash}`,
...@@ -212,10 +214,11 @@ describe('Project Licenses', () => { ...@@ -212,10 +214,11 @@ describe('Project Licenses', () => {
}); });
}); });
it(`sets the tabIndex to be "${expectedTabIndex}`, () => { it(`sets the tabIndex to be "${expectedTabIndex}"`, () => {
expect(wrapper.find(GlTabs).attributes('value')).toBe(`${expectedTabIndex}`); expect(wrapper.find(GlTabs).attributes('value')).toBe(`${expectedTabIndex}`);
}); });
}); },
);
it.each` it.each`
givenTabIndex | expectedLocationHash givenTabIndex | expectedLocationHash
......
...@@ -8,7 +8,7 @@ describe('setWindowLocationHelper', () => { ...@@ -8,7 +8,7 @@ describe('setWindowLocationHelper', () => {
}); });
it.each` it.each`
locationProperty | value property | value
${'hash'} | ${'foo'} ${'hash'} | ${'foo'}
${'host'} | ${'gitlab.com'} ${'host'} | ${'gitlab.com'}
${'hostname'} | ${'gitlab.com'} ${'hostname'} | ${'gitlab.com'}
...@@ -17,13 +17,13 @@ describe('setWindowLocationHelper', () => { ...@@ -17,13 +17,13 @@ describe('setWindowLocationHelper', () => {
${'origin'} | ${'/foo'} ${'origin'} | ${'/foo'}
${'port'} | ${'80'} ${'port'} | ${'80'}
${'protocol'} | ${'https:'} ${'protocol'} | ${'https:'}
`('sets "window.location.$locationProperty" to be $value', ({ locationProperty, value }) => { `('sets "window.location.$property" to be $value', ({ property, value }) => {
expect(window.location[locationProperty]).not.toBe(value); expect(window.location).toBe(originalLocation);
setWindowLocationHelper({ setWindowLocationHelper({
[locationProperty]: value, [property]: value,
}); });
expect(window.location[locationProperty]).toBe(value); expect(window.location[property]).toBe(value);
}); });
}); });
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