Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
atomcorp committed Feb 22, 2021
1 parent bcc85ff commit 1d25ce0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ private.json
.env.private
server/log.txt
private.todo
cypress/videos
cypress/screenshots
app/cypress/videos
app/cypress/screenshots
28 changes: 14 additions & 14 deletions app/cypress/integration/themes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ describe('Windows Terminal Themes - big screen', function () {
cy.route(/api\/v1\/themes/).as('themes');
cy.visit('/themes');
cy.wait('@themes').then((xhr) => {
cy.wrap(xhr.response.body.filter((theme) => theme.isDark)).as(
cy.wrap(xhr.response.body.filter((theme) => theme.meta.isDark)).as(
'darkThemes'
);
cy.wrap(xhr.response.body.filter((theme) => !theme.isDark)).as(
cy.wrap(xhr.response.body.filter((theme) => !theme.meta.isDark)).as(
'lightThemes'
);
});
Expand Down Expand Up @@ -47,8 +47,8 @@ describe('Windows Terminal Themes - big screen', function () {
it('should show all dark themes and no light themes by default', function () {
cy.get('@themes').then((xhr) => {
const themes = xhr.response.body;
const lightThemes = themes.filter((theme) => !theme.isDark);
const darkThemes = themes.filter((theme) => theme.isDark);
const lightThemes = themes.filter((theme) => !theme.meta.isDark);
const darkThemes = themes.filter((theme) => theme.meta.isDark);
cy.findAllByTestId('theme-option').should(
'have.length',
darkThemes.length
Expand All @@ -67,8 +67,8 @@ describe('Windows Terminal Themes - big screen', function () {
cy.findByLabelText(/Light/).should('be.checked');
cy.get('@themes').then((xhr) => {
const themes = xhr.response.body;
const lightThemes = themes.filter((theme) => !theme.isDark);
const darkThemes = themes.filter((theme) => theme.isDark);
const lightThemes = themes.filter((theme) => !theme.meta.isDark);
const darkThemes = themes.filter((theme) => theme.meta.isDark);
cy.findAllByTestId('theme-option').should(
'have.length',
lightThemes.length
Expand Down Expand Up @@ -179,10 +179,10 @@ describe('Themes - small screen', function () {
cy.route(/api\/v1\/themes/).as('themes');
cy.visit('/themes');
cy.wait('@themes').then((xhr) => {
cy.wrap(xhr.response.body.filter((theme) => theme.isDark)).as(
cy.wrap(xhr.response.body.filter((theme) => theme.meta.isDark)).as(
'darkThemes'
);
cy.wrap(xhr.response.body.filter((theme) => !theme.isDark)).as(
cy.wrap(xhr.response.body.filter((theme) => !theme.meta.isDark)).as(
'lightThemes'
);
});
Expand All @@ -191,8 +191,8 @@ describe('Themes - small screen', function () {
it('default to first dark theme', function () {
cy.get('@themes').then((xhr) => {
const themes = xhr.response.body;
const lightThemes = themes.filter((theme) => !theme.isDark);
const darkThemes = themes.filter((theme) => theme.isDark);
const lightThemes = themes.filter((theme) => !theme.meta.isDark);
const darkThemes = themes.filter((theme) => theme.meta.isDark);
cy.findAllByTestId('theme-option').should(
'have.length',
darkThemes.length
Expand Down Expand Up @@ -270,10 +270,10 @@ describe('Preview views', function () {
cy.route(/api\/v1\/themes/).as('themes');
cy.visit('/themes');
cy.wait('@themes').then((xhr) => {
cy.wrap(xhr.response.body.filter((theme) => theme.isDark)).as(
cy.wrap(xhr.response.body.filter((theme) => theme.meta.isDark)).as(
'darkThemes'
);
cy.wrap(xhr.response.body.filter((theme) => !theme.isDark)).as(
cy.wrap(xhr.response.body.filter((theme) => !theme.meta.isDark)).as(
'lightThemes'
);
});
Expand Down Expand Up @@ -361,10 +361,10 @@ describe('Keyboard navigation', function () {
cy.route(/api\/v1\/themes/).as('themes');
cy.visit('/themes');
cy.wait('@themes').then((xhr) => {
cy.wrap(xhr.response.body.filter((theme) => theme.isDark)).as(
cy.wrap(xhr.response.body.filter((theme) => theme.meta.isDark)).as(
'darkThemes'
);
cy.wrap(xhr.response.body.filter((theme) => !theme.isDark)).as(
cy.wrap(xhr.response.body.filter((theme) => !theme.meta.isDark)).as(
'lightThemes'
);
});
Expand Down
1 change: 1 addition & 0 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ app.get('/', (req, res) => {
});

app.listen(port, () =>
// eslint-disable-next-line no-console
console.log(`Example app listening at http://localhost:${port}`)
);

0 comments on commit 1d25ce0

Please sign in to comment.