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

Reviewer feedback: Test description fixes

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