const { expectValidateFixturesResult } = require( './lib' ); describe( 'validation success', () => { it( 'should succeed with valid data', () => { expectValidateFixturesResult( 'valid', { errorCount: 0, output: [], } ); } ); } ); describe( 'validation errors', () => { it( 'should catch invalid table rows', () => { expectValidateFixturesResult( 'bad-table-rows', { errorCount: 2, output: [ 'README.md: Expected 3 table cells but found 2: [10up](/company-profiles/10up.md) | https://10up.com/', 'README.md: Expected 3 table cells but found 4: [18F](/company-profiles/18f.md) | https://18f.gsa.gov/ | USA | something else', ], } ); } ); it( 'should catch missing company names', () => { expectValidateFixturesResult( 'missing-company-names', { errorCount: 11, output: [ 'README.md: Company "⚠⚠⚠" has no linked Markdown profile ("/company-profiles/.md")', 'README.md: Missing company name:
Some extra content.
', '18f.md: Duplicate section: "Company size".', '18f.md: Empty section: "Region". Fill it in or leave it out instead.', '18f.md: Empty section: "Remote status". Fill it in or leave it out instead.', '1password.md: The main title is wrapped inside of another element.', '1password.md: The section heading for "Company size" is wrapped inside of another element.', '1password.md: Content is not part of any section:', 'and-yet.md: Required section "Company blurb" not found.', ], } ); } ); it( 'should catch text outside of links in readme', () => { expectValidateFixturesResult( 'name-outside-link', { errorCount: 3, output: [ 'README.md: Extra text in company name: "10up", "10up agency"', 'README.md: Extra text in company name: "Aerolab", "Aerolab more text"', 'README.md: Extra text in company name: "AngularClass", "AngularClass text"', ], } ); } ); it( 'should catch mismatched "incomplete profile" indicators', () => { expectValidateFixturesResult( 'mismatched-incomplete-indicators', { errorCount: 9, output: [ '10up.md: Profile is marked as complete, but it only contains a "Company blurb" heading.', '17hats.md: Profile looks complete, but the "Company blurb" contains a warning emoji.', '18f.md: Profile looks incomplete, but the main readme does not contain a warning emoji.', ( '45royale.md: Profile is marked as incomplete, but it contains multiple sections.' + '\nPlease remove the warning emoji from the "Company blurb" section and the main readme.' ), 'aerolab.md: Profile looks incomplete, but the "Company blurb" does not contain a warning emoji.', 'and-yet.md: Profile looks complete, but the main readme contains a warning emoji.', 'angularclass.md: Profile looks incomplete, but the "Company blurb" does not contain a warning emoji.', 'anomali.md: Invalid section: "Invalid section name". Expected one of: ["Company blurb","Company size","Remote status","Region","Company technologies","Office locations","How to apply"]', 'anomali.md: Required section "Company blurb" not found.', ], } ); } ); } );1Password