Commit b321b40a authored by Jannik Lehmann's avatar Jannik Lehmann

Refactor Specs

parent 632524a7
...@@ -82,7 +82,7 @@ describe('redesigned App component', () => { ...@@ -82,7 +82,7 @@ describe('redesigned App component', () => {
}); });
it('renders right amount of tabs with correct title ', () => { it('renders right amount of tabs with correct title ', () => {
expect(findTabs().length).toEqual(2); expect(findTabs()).toHaveLength(2);
}); });
it('renders security-testing tab', () => { it('renders security-testing tab', () => {
...@@ -95,7 +95,7 @@ describe('redesigned App component', () => { ...@@ -95,7 +95,7 @@ describe('redesigned App component', () => {
it('renders right amount of feature cards for given props with correct props', () => { it('renders right amount of feature cards for given props with correct props', () => {
const cards = findFeatureCards(); const cards = findFeatureCards();
expect(cards.length).toEqual(2); expect(cards).toHaveLength(2);
expect(cards.at(0).props()).toEqual({ feature: securityFeaturesMock[0] }); expect(cards.at(0).props()).toEqual({ feature: securityFeaturesMock[0] });
expect(cards.at(1).props()).toEqual({ feature: complianceFeaturesMock[0] }); expect(cards.at(1).props()).toEqual({ feature: complianceFeaturesMock[0] });
}); });
...@@ -115,23 +115,23 @@ describe('redesigned App component', () => { ...@@ -115,23 +115,23 @@ describe('redesigned App component', () => {
}); });
it('should show latest pipeline info on the security tab with correct link when latestPipelinePath is defined', () => { it('should show latest pipeline info on the security tab with correct link when latestPipelinePath is defined', () => {
expect(findByTestId('latest-pipeline-info-security').exists()).toBe(true); const latestPipelineInfoSecurity = findByTestId('latest-pipeline-info-security');
expect(findByTestId('latest-pipeline-info-security').text()).toMatchInterpolatedText(
expect(latestPipelineInfoSecurity.exists()).toBe(true);
expect(latestPipelineInfoSecurity.text()).toMatchInterpolatedText(
i18n.securityTestingDescription, i18n.securityTestingDescription,
); );
expect(findByTestId('latest-pipeline-info-security').find('a').attributes('href')).toBe( expect(latestPipelineInfoSecurity.find('a').attributes('href')).toBe('test/path');
'test/path',
);
}); });
it('should show latest pipeline info on the compliance tab with correct link when latestPipelinePath is defined', () => { it('should show latest pipeline info on the compliance tab with correct link when latestPipelinePath is defined', () => {
expect(findByTestId('latest-pipeline-info-compliance').exists()).toBe(true); const latestPipelineInfoCompliance = findByTestId('latest-pipeline-info-compliance');
expect(findByTestId('latest-pipeline-info-compliance').text()).toMatchInterpolatedText(
expect(latestPipelineInfoCompliance.exists()).toBe(true);
expect(latestPipelineInfoCompliance.text()).toMatchInterpolatedText(
i18n.securityTestingDescription, i18n.securityTestingDescription,
); );
expect(findByTestId('latest-pipeline-info-compliance').find('a').attributes('href')).toBe( expect(latestPipelineInfoCompliance.find('a').attributes('href')).toBe('test/path');
'test/path',
);
}); });
}); });
}); });
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