chore(deps): upgrade eslint, prettier & related packages

This commit is contained in:
Mrugesh Mohapatra
2021-03-11 00:31:46 +05:30
committed by Mrugesh Mohapatra
parent 0a53a1d7f0
commit 6c91f81b0e
94 changed files with 1462 additions and 1411 deletions

View File

@ -1,7 +1,7 @@
/* global cy */
describe('A certification,', function() {
describe('while viewing your own,', function() {
describe('A certification,', function () {
describe('while viewing your own,', function () {
before(() => {
cy.visit('/');
cy.contains("Get started (it's free)").click({ force: true });
@ -51,7 +51,7 @@ describe('A certification,', function() {
.click({ force: true });
});
it('should render a LinkedIn button', function() {
it('should render a LinkedIn button', function () {
cy.contains('Add this certification to my LinkedIn profile')
.should('have.attr', 'href')
.and(
@ -61,7 +61,7 @@ describe('A certification,', function() {
);
});
it('should render a Twitter button', function() {
it('should render a Twitter button', function () {
cy.contains('Share this certification on Twitter').should(
'have.attr',
'href',
@ -78,20 +78,20 @@ describe('A certification,', function() {
});
});
describe("while viewing someone else's,", function() {
describe("while viewing someone else's,", function () {
before(() => {
cy.go('back');
cy.contains('Sign me out of freeCodeCamp').click({ force: true });
cy.visit('/certification/developmentuser/legacy-front-end');
});
it('should not render a LinkedIn button', function() {
it('should not render a LinkedIn button', function () {
cy.contains('Add this certification to my LinkedIn profile').should(
'not.exist'
);
});
it('should not render a Twitter button', function() {
it('should not render a Twitter button', function () {
cy.contains('Share this certification on Twitter').should('not.exist');
});
});

View File

@ -43,43 +43,28 @@ describe('Landing page', () => {
});
it('Has 5 brand logos', () => {
cy.get('.logo-row')
.children()
.its('length')
.should('eq', 5);
cy.get('.logo-row').children().its('length').should('eq', 5);
});
it('Has `as seens as` section', () => {
cy.contains('Build projects.').should('be.visible');
cy.get('.big-heading')
.siblings()
.get('svg');
cy.get('.big-heading').siblings().get('svg');
});
it('Has a visible large image on large viewports', function() {
cy.viewport(1200, 660)
.get(selectors.landingPageImage)
.should('be.visible');
it('Has a visible large image on large viewports', function () {
cy.viewport(1200, 660).get(selectors.landingPageImage).should('be.visible');
cy.viewport(1199, 660)
.get(selectors.landingPageImage)
.should('not.exist');
cy.viewport(1199, 660).get(selectors.landingPageImage).should('not.exist');
});
it('Has links to all the certifications', function() {
cy.get(selectors.certifications)
.children()
.its('length')
.should('eq', 10);
it('Has links to all the certifications', function () {
cy.get(selectors.certifications).children().its('length').should('eq', 10);
cy.wrap(certifications).each(cert => {
cy.get(selectors.certifications).contains(cert);
});
});
it('Has 3 testimonial cards', function() {
cy.get(selectors.testimonials)
.children()
.its('length')
.should('eq', 3);
it('Has 3 testimonial cards', function () {
cy.get(selectors.testimonials).children().its('length').should('eq', 3);
});
});

View File

@ -15,7 +15,7 @@ const unhandledErrorMessage = 'Something is not quite right';
const runningOutput = '// running tests';
const finishedOutput = '// tests completed';
describe('Backend challenge', function() {
describe('Backend challenge', function () {
it('renders', () => {
cy.visit(locations.index);

View File

@ -23,7 +23,7 @@ const defaultOutput = `
// const runningOutput = '// running tests';
// const finishedOutput = '// tests completed';
describe('Classic challenge', function() {
describe('Classic challenge', function () {
it('renders', () => {
cy.visit(locations.index);

View File

@ -12,7 +12,7 @@ const selectors = {
let appHasStarted;
function spyOnListener(win) {
const addListener = win.EventTarget.prototype.addEventListener;
win.EventTarget.prototype.addEventListener = function(name) {
win.EventTarget.prototype.addEventListener = function (name) {
if (name === 'click') {
appHasStarted = true;
win.EventTarget.prototype.addEventListener = addListener;
@ -68,9 +68,7 @@ describe('Navbar', () => {
() => {
cy.get(selectors.menuButton).click();
cy.get(selectors.navigationLinks).contains('Forum');
cy.get(selectors.navigationLinks)
.contains('Curriculum')
.click();
cy.get(selectors.navigationLinks).contains('Curriculum').click();
cy.url().should('include', '/learn');
cy.get(selectors.navigationLinks).contains('Curriculum');
cy.get(selectors.navigationLinks).contains('Forum');
@ -84,9 +82,7 @@ describe('Navbar', () => {
() => {
cy.contains(selectors.smallCallToAction, 'Sign in');
cy.get(selectors.menuButton).click();
cy.get(selectors.navigationLinks)
.contains('Curriculum')
.click();
cy.get(selectors.navigationLinks).contains('Curriculum').click();
cy.contains(selectors.smallCallToAction, 'Sign in');
}
);
@ -95,9 +91,7 @@ describe('Navbar', () => {
cy.login();
cy.get('a[href*="/settings"]').should('be.visible');
cy.get(selectors.menuButton).click();
cy.get(selectors.navigationLinks)
.contains('Profile')
.click();
cy.get(selectors.navigationLinks).contains('Profile').click();
cy.url().should('include', '/developmentuser');
});

View File

@ -30,17 +30,13 @@ describe('Search bar', () => {
it('Should accept input and display hits', () => {
search('freeCodeCamp');
cy.get('.ais-Hits-list')
.children()
.should('to.have.length.of.at.least', 1);
cy.get('.ais-Hits-list').children().should('to.have.length.of.at.least', 1);
});
it('Should clear hits when input is cleared', () => {
search('freeCodeCamp');
cy.get('.ais-Hits-list')
.children()
.should('to.have.length.of.at.least', 1);
cy.get('.ais-Hits-list').children().should('to.have.length.of.at.least', 1);
clear();
@ -52,9 +48,7 @@ describe('Search bar', () => {
search('freeCodeCamp');
cy.get('.ais-Hits-list')
.children()
.should('to.have.length.of', 8);
cy.get('.ais-Hits-list').children().should('to.have.length.of', 8);
});
it('Should show up to 5 hits when height < 768px', () => {
@ -62,17 +56,13 @@ describe('Search bar', () => {
search('freeCodeCamp');
cy.get('.ais-Hits-list')
.children()
.should('to.have.length.of', 5);
cy.get('.ais-Hits-list').children().should('to.have.length.of', 5);
});
it('Should show no hits for queries that do not exist in the Algolia index', () => {
search('testtttt');
cy.get('.ais-Hits-list')
.children()
.should('to.have.length.of', 0);
cy.get('.ais-Hits-list').children().should('to.have.length.of', 0);
cy.contains('No tutorials found');
});

View File

@ -1,11 +1,11 @@
/* global cy */
describe('The `Update my account settings` button works properly', function() {
describe('The `Update my account settings` button works properly', function () {
beforeEach(() => {
cy.login();
});
it('Should take user to their account settings when clicked', function() {
it('Should take user to their account settings when clicked', function () {
cy.contains('Update my account settings').click();
cy.url().should('include', '/settings');
});

View File

@ -13,7 +13,7 @@ const locations = {
'/learn/responsive-web-design/basic-html-and-html5/say-hello-to-html-elements'
};
describe('challenges/superblock redirect', function() {
describe('challenges/superblock redirect', function () {
it('redirects to learn/superblock', () => {
cy.visit(locations.chalSuper);
@ -24,7 +24,7 @@ describe('challenges/superblock redirect', function() {
});
});
describe('challenges/superblock/block redirect', function() {
describe('challenges/superblock/block redirect', function () {
it('redirects to learn/superblock/block', () => {
cy.visit(locations.chalBlock);
@ -35,7 +35,7 @@ describe('challenges/superblock/block redirect', function() {
});
});
describe('challenges/superblock/block/challenge redirect', function() {
describe('challenges/superblock/block/challenge redirect', function () {
it('redirects to learn/superblock/block/challenge', () => {
cy.visit(locations.chalChallenge);

View File

@ -61,7 +61,7 @@ const warningMessage =
'If the tests fail, try disabling your extensions for the most reliable ' +
'experience.';
describe('Basic Css Introduction page', function() {
describe('Basic Css Introduction page', function () {
it('renders', () => {
cy.visit(locations.index);

View File

@ -96,9 +96,7 @@ describe('Username input field', () => {
'the URL to your profile and your certifications.'
).should('not.exist');
cy.get('@usernameForm')
.contains('Save')
.should('be.disabled');
cy.get('@usernameForm').contains('Save').should('be.disabled');
});
it('Should not show anything if user types their current name', () => {
@ -106,9 +104,7 @@ describe('Username input field', () => {
.clear({ force: true })
.type('developmentuser', { force: true });
cy.get('@usernameForm')
.contains('Save')
.should('be.disabled');
cy.get('@usernameForm').contains('Save').should('be.disabled');
});
// eslint-disable-next-line max-len
@ -117,9 +113,7 @@ describe('Username input field', () => {
.clear({ force: true })
.type('developmentuser', { force: true });
cy.get('@usernameForm')
.contains('Save')
.should('be.disabled');
cy.get('@usernameForm').contains('Save').should('be.disabled');
});
it('Should show warning if username includes invalid character', () => {
@ -141,9 +135,7 @@ describe('Username input field', () => {
.clear({ force: true })
.type('Quincy Larson', { force: true });
cy.get('@usernameForm')
.contains('Save')
.should('be.disabled');
cy.get('@usernameForm').contains('Save').should('be.disabled');
});
it('Should change username if `Save` button is clicked', () => {
@ -153,9 +145,7 @@ describe('Username input field', () => {
cy.contains('Username is available');
cy.get('@usernameForm')
.contains('Save')
.click({ force: true });
cy.get('@usernameForm').contains('Save').click({ force: true });
cy.contains('Account Settings for quincy').should('be.visible');
cy.resetUsername();