-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db30b4b
commit 20a2a9a
Showing
31 changed files
with
706 additions
and
742 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
arrowParens: avoid | ||
bracketSpacing: false | ||
trailingComma: all | ||
tabWidth: 2 | ||
semi: false | ||
singleQuote: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
it("should work", () => { | ||
cy.visit("/"); | ||
cy.get("#name").should("be.focused").type("Dan"); | ||
cy.contains("button", "NEXT").click(); | ||
it('should work', () => { | ||
cy.visit('/') | ||
cy.get('#name').should('be.focused').type('Dan') | ||
cy.contains('button', 'NEXT').click() | ||
|
||
cy.url().should("include", "/you"); | ||
cy.get(".calendar-date").last().click(); | ||
cy.contains("button", "NEXT").click(); | ||
cy.url().should('include', '/you') | ||
cy.get('.calendar-date').last().click() | ||
cy.contains('button', 'NEXT').click() | ||
|
||
cy.url().should("include", "/everyone"); | ||
cy.get(".invitee").should("contain.text", "Dan"); | ||
cy.get(".streaming-status").should("contain.text", "Live-streaming updates"); | ||
cy.url().should('include', '/everyone') | ||
cy.get('.invitee').should('contain.text', 'Dan') | ||
cy.get('.streaming-status').should('contain.text', 'Live-streaming updates') | ||
|
||
cy.task("updateSocial"); | ||
cy.reload(); // This shouldn't be necessary but HTTP2 isn't supported by Cypress so streaming doesn't work | ||
cy.get(".invitee").should("contain.text", "Max"); | ||
cy.task('updateSocial') | ||
cy.reload() // This shouldn't be necessary but HTTP2 isn't supported by Cypress so streaming doesn't work | ||
cy.get('.invitee').should('contain.text', 'Max') | ||
|
||
cy.wait(1000); // Fix weird re-render that changes date format and resets checked state | ||
cy.get('#best-dates [type="radio"]').first().check(); | ||
cy.contains("button", "NEXT").click(); | ||
cy.wait(1000) // Fix weird re-render that changes date format and resets checked state | ||
cy.get('#best-dates [type="radio"]').first().check() | ||
cy.contains('button', 'NEXT').click() | ||
|
||
cy.url().should("include", "/decision"); | ||
cy.contains("Your social is on"); | ||
}); | ||
cy.url().should('include', '/decision') | ||
cy.contains('Your social is on') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,50 @@ | ||
import faunadb from 'faunadb' | ||
import { toSocialId } from '../src/lib/id.js' | ||
import {toSocialId} from '../src/lib/id.js' | ||
|
||
const q = faunadb.query | ||
|
||
const client = new faunadb.Client({ | ||
domain: process.env.FAUNADB_DOMAIN, | ||
port: process.env.FAUNADB_PORT, | ||
scheme: process.env.FAUNADB_SCHEME, | ||
secret: process.env.FAUNADB_SERVER_SECRET, | ||
domain: process.env.FAUNADB_DOMAIN, | ||
port: process.env.FAUNADB_PORT, | ||
scheme: process.env.FAUNADB_SCHEME, | ||
secret: process.env.FAUNADB_SERVER_SECRET, | ||
}) | ||
|
||
function todayPlus(days) { | ||
return q.TimeAdd(q.ToDate(q.Now()), days, "days") | ||
return q.TimeAdd(q.ToDate(q.Now()), days, 'days') | ||
} | ||
|
||
const response = await client.query( | ||
q.Create( | ||
q.Collection('social'), | ||
{ | ||
data: { | ||
invitees: { | ||
"cbc9de47-185b-4115-a2a5-e4e8dbe6e249": { | ||
name: "Dan", | ||
dates: [ | ||
todayPlus(1), | ||
todayPlus(5), | ||
todayPlus(6), | ||
] | ||
}, | ||
"d742dc09-c309-4f2c-9b33-c817b51c1537": { | ||
name: "Max", | ||
dates: [ | ||
todayPlus(2), | ||
todayPlus(6), | ||
] | ||
}, | ||
"5c15e5ec-3a5c-4518-9224-591635a38bb8": { | ||
name: "Tom", | ||
dates: [ | ||
todayPlus(8), | ||
todayPlus(6), | ||
todayPlus(10), | ||
] | ||
}, | ||
"9d5c15e5-ec3a-4c35-98d2-24591635a38b": { | ||
name: "King Daddy Sexy Robo III", | ||
dates: [ | ||
todayPlus(1), | ||
todayPlus(6), | ||
] | ||
}, | ||
"6bb56257-f312-484f-ac7b-458bcaa76b5f": { | ||
name: "Jim", | ||
dates: [ | ||
todayPlus(5), | ||
todayPlus(6), | ||
] | ||
}, | ||
"fe9d5c15-e5ec-4a5c-b518-d224591635a3": { | ||
name: "Mike", | ||
dates: [ | ||
todayPlus(15), | ||
todayPlus(3), | ||
todayPlus(6), | ||
] | ||
} | ||
} | ||
} | ||
} | ||
) | ||
q.Create(q.Collection('social'), { | ||
data: { | ||
invitees: { | ||
'cbc9de47-185b-4115-a2a5-e4e8dbe6e249': { | ||
name: 'Dan', | ||
dates: [todayPlus(1), todayPlus(5), todayPlus(6)], | ||
}, | ||
'd742dc09-c309-4f2c-9b33-c817b51c1537': { | ||
name: 'Max', | ||
dates: [todayPlus(2), todayPlus(6)], | ||
}, | ||
'5c15e5ec-3a5c-4518-9224-591635a38bb8': { | ||
name: 'Tom', | ||
dates: [todayPlus(8), todayPlus(6), todayPlus(10)], | ||
}, | ||
'9d5c15e5-ec3a-4c35-98d2-24591635a38b': { | ||
name: 'King Daddy Sexy Robo III', | ||
dates: [todayPlus(1), todayPlus(6)], | ||
}, | ||
'6bb56257-f312-484f-ac7b-458bcaa76b5f': { | ||
name: 'Jim', | ||
dates: [todayPlus(5), todayPlus(6)], | ||
}, | ||
'fe9d5c15-e5ec-4a5c-b518-d224591635a3': { | ||
name: 'Mike', | ||
dates: [todayPlus(15), todayPlus(3), todayPlus(6)], | ||
}, | ||
}, | ||
}, | ||
}), | ||
) | ||
const socialId = toSocialId(response.ref.id) | ||
console.info(`http://localhost:6602/${socialId}/everyone`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
[ | ||
{ | ||
"invitees": { | ||
"cbc9de47-185b-4115-a2a5-e4e8dbe6e249": { | ||
"name": "Dan" | ||
}, | ||
"d742dc09-c309-4f2c-9b33-c817b51c1537": { | ||
"name": "Max" | ||
}, | ||
"5c15e5ec-3a5c-4518-9224-591635a38bb8": { | ||
"name": "Tom" | ||
}, | ||
"9d5c15e5-ec3a-4c35-98d2-24591635a38b": { | ||
"name": "King Daddy Sexy Robo III" | ||
}, | ||
"6bb56257-f312-484f-ac7b-458bcaa76b5f": { | ||
"name": "Jim" | ||
}, | ||
"fe9d5c15-e5ec-4a5c-b518-d224591635a3": { | ||
"name": "Mike" | ||
} | ||
} | ||
} | ||
{ | ||
"invitees": { | ||
"cbc9de47-185b-4115-a2a5-e4e8dbe6e249": { | ||
"name": "Dan" | ||
}, | ||
"d742dc09-c309-4f2c-9b33-c817b51c1537": { | ||
"name": "Max" | ||
}, | ||
"5c15e5ec-3a5c-4518-9224-591635a38bb8": { | ||
"name": "Tom" | ||
}, | ||
"9d5c15e5-ec3a-4c35-98d2-24591635a38b": { | ||
"name": "King Daddy Sexy Robo III" | ||
}, | ||
"6bb56257-f312-484f-ac7b-458bcaa76b5f": { | ||
"name": "Jim" | ||
}, | ||
"fe9d5c15-e5ec-4a5c-b518-d224591635a3": { | ||
"name": "Mike" | ||
} | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta | ||
name="description" | ||
content="Trying to find a date when friends are free can be a painful process, especially over text. We save you time by collecting everyone's availability and presenting you with the best dates with a minimum of fuss." | ||
/> | ||
<link rel="icon" href="/favicon.png" /> | ||
<meta | ||
name="viewport" | ||
content="width=device-width, initial-scale=1, shrink-to-fit=no" | ||
/> | ||
<link rel="preconnect" href="https://fonts.googleapis.com" /> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&family=Port+Lligat+Slab&display=swap" | ||
rel="stylesheet" | ||
/> | ||
%svelte.head% | ||
</head> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="description" | ||
content="Trying to find a date when friends are free can be a painful process, especially over text. We save you time by collecting everyone's availability and presenting you with the best dates with a minimum of fuss."> | ||
<link rel="icon" href="/favicon.png" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> | ||
<link rel="preconnect" href="https://fonts.googleapis.com" /> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> | ||
<link href="https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&family=Port+Lligat+Slab&display=swap" | ||
rel="stylesheet" /> | ||
%svelte.head% | ||
</head> | ||
|
||
<body> | ||
<div id="svelte">%svelte.body%</div> | ||
</body> | ||
|
||
<body> | ||
<div id="svelte">%svelte.body%</div> | ||
</body> | ||
</html> |
Oops, something went wrong.