chore: Move to prettier standard double quotes (#1309)
This commit is contained in:
@ -1,21 +1,21 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import TestServer from 'fetch-test-server';
|
||||
import app from '../app';
|
||||
import { View, CollectionUser } from '../models';
|
||||
import { flushdb, seed } from '../test/support';
|
||||
import { buildUser } from '../test/factories';
|
||||
import TestServer from "fetch-test-server";
|
||||
import app from "../app";
|
||||
import { View, CollectionUser } from "../models";
|
||||
import { flushdb, seed } from "../test/support";
|
||||
import { buildUser } from "../test/factories";
|
||||
|
||||
const server = new TestServer(app.callback());
|
||||
|
||||
beforeEach(flushdb);
|
||||
afterAll(server.close);
|
||||
|
||||
describe('#views.list', async () => {
|
||||
it('should return views for a document', async () => {
|
||||
describe("#views.list", async () => {
|
||||
it("should return views for a document", async () => {
|
||||
const { user, document } = await seed();
|
||||
await View.increment({ documentId: document.id, userId: user.id });
|
||||
|
||||
const res = await server.post('/api/views.list', {
|
||||
const res = await server.post("/api/views.list", {
|
||||
body: { token: user.getJwtToken(), documentId: document.id },
|
||||
});
|
||||
const body = await res.json();
|
||||
@ -25,7 +25,7 @@ describe('#views.list', async () => {
|
||||
expect(body.data[0].user.name).toBe(user.name);
|
||||
});
|
||||
|
||||
it('should return views for a document in read-only collection', async () => {
|
||||
it("should return views for a document in read-only collection", async () => {
|
||||
const { user, document, collection } = await seed();
|
||||
collection.private = true;
|
||||
await collection.save();
|
||||
@ -34,12 +34,12 @@ describe('#views.list', async () => {
|
||||
createdById: user.id,
|
||||
collectionId: collection.id,
|
||||
userId: user.id,
|
||||
permission: 'read',
|
||||
permission: "read",
|
||||
});
|
||||
|
||||
await View.increment({ documentId: document.id, userId: user.id });
|
||||
|
||||
const res = await server.post('/api/views.list', {
|
||||
const res = await server.post("/api/views.list", {
|
||||
body: { token: user.getJwtToken(), documentId: document.id },
|
||||
});
|
||||
const body = await res.json();
|
||||
@ -49,9 +49,9 @@ describe('#views.list', async () => {
|
||||
expect(body.data[0].user.name).toBe(user.name);
|
||||
});
|
||||
|
||||
it('should require authentication', async () => {
|
||||
it("should require authentication", async () => {
|
||||
const { document } = await seed();
|
||||
const res = await server.post('/api/views.list', {
|
||||
const res = await server.post("/api/views.list", {
|
||||
body: { documentId: document.id },
|
||||
});
|
||||
const body = await res.json();
|
||||
@ -60,20 +60,20 @@ describe('#views.list', async () => {
|
||||
expect(body).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should require authorization', async () => {
|
||||
it("should require authorization", async () => {
|
||||
const { document } = await seed();
|
||||
const user = await buildUser();
|
||||
const res = await server.post('/api/views.list', {
|
||||
const res = await server.post("/api/views.list", {
|
||||
body: { token: user.getJwtToken(), documentId: document.id },
|
||||
});
|
||||
expect(res.status).toEqual(403);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#views.create', async () => {
|
||||
it('should allow creating a view record for document', async () => {
|
||||
describe("#views.create", async () => {
|
||||
it("should allow creating a view record for document", async () => {
|
||||
const { user, document } = await seed();
|
||||
const res = await server.post('/api/views.create', {
|
||||
const res = await server.post("/api/views.create", {
|
||||
body: { token: user.getJwtToken(), documentId: document.id },
|
||||
});
|
||||
const body = await res.json();
|
||||
@ -82,7 +82,7 @@ describe('#views.create', async () => {
|
||||
expect(body.data.count).toBe(1);
|
||||
});
|
||||
|
||||
it('should allow creating a view record for document in read-only collection', async () => {
|
||||
it("should allow creating a view record for document in read-only collection", async () => {
|
||||
const { user, document, collection } = await seed();
|
||||
collection.private = true;
|
||||
await collection.save();
|
||||
@ -91,10 +91,10 @@ describe('#views.create', async () => {
|
||||
createdById: user.id,
|
||||
collectionId: collection.id,
|
||||
userId: user.id,
|
||||
permission: 'read',
|
||||
permission: "read",
|
||||
});
|
||||
|
||||
const res = await server.post('/api/views.create', {
|
||||
const res = await server.post("/api/views.create", {
|
||||
body: { token: user.getJwtToken(), documentId: document.id },
|
||||
});
|
||||
const body = await res.json();
|
||||
@ -103,9 +103,9 @@ describe('#views.create', async () => {
|
||||
expect(body.data.count).toBe(1);
|
||||
});
|
||||
|
||||
it('should require authentication', async () => {
|
||||
it("should require authentication", async () => {
|
||||
const { document } = await seed();
|
||||
const res = await server.post('/api/views.create', {
|
||||
const res = await server.post("/api/views.create", {
|
||||
body: { documentId: document.id },
|
||||
});
|
||||
const body = await res.json();
|
||||
@ -114,10 +114,10 @@ describe('#views.create', async () => {
|
||||
expect(body).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should require authorization', async () => {
|
||||
it("should require authorization", async () => {
|
||||
const { document } = await seed();
|
||||
const user = await buildUser();
|
||||
const res = await server.post('/api/views.create', {
|
||||
const res = await server.post("/api/views.create", {
|
||||
body: { token: user.getJwtToken(), documentId: document.id },
|
||||
});
|
||||
expect(res.status).toEqual(403);
|
||||
|
Reference in New Issue
Block a user