diff --git a/__snapshots__/prs-header--author-loading.png b/__snapshots__/prs-header--author-loading.png new file mode 100644 index 0000000..50536cd Binary files /dev/null and b/__snapshots__/prs-header--author-loading.png differ diff --git a/__snapshots__/prs-header--loading.png b/__snapshots__/prs-header--loading.png new file mode 100644 index 0000000..13c5a82 Binary files /dev/null and b/__snapshots__/prs-header--loading.png differ diff --git a/__snapshots__/prs-header--long-and-no-spaces.png b/__snapshots__/prs-header--long-and-no-spaces.png new file mode 100644 index 0000000..a80c11c Binary files /dev/null and b/__snapshots__/prs-header--long-and-no-spaces.png differ diff --git a/__snapshots__/prs-header--long-details.png b/__snapshots__/prs-header--long-details.png new file mode 100644 index 0000000..1fb5dbc Binary files /dev/null and b/__snapshots__/prs-header--long-details.png differ diff --git a/__snapshots__/prs-header--short-details.png b/__snapshots__/prs-header--short-details.png new file mode 100644 index 0000000..786109c Binary files /dev/null and b/__snapshots__/prs-header--short-details.png differ diff --git a/__snapshots__/prs-header.test.js.snap b/__snapshots__/prs-header.test.js.snap new file mode 100644 index 0000000..68eea12 --- /dev/null +++ b/__snapshots__/prs-header.test.js.snap @@ -0,0 +1,123 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PRs/Header Author Loading smoke-test 1`] = ` +
+
+ short title +
+
+ +
+ opened 3 months ago +
+
+
+
+
+
+
+`; + +exports[`PRs/Header Long Details smoke-test 1`] = ` +
+
+ rather long title that goes on and on and on and on and on and on... +
+
+ +
+ opened a minute ago +
+
+ DanConwayDev +
+
+
+`; + +exports[`PRs/Header Long and No Spaces smoke-test 1`] = ` +
+
+ LongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameL... +
+
+ +
+ opened 3 months ago +
+
+ DanConwayDev +
+
+
+`; + +exports[`PRs/Header Short Details smoke-test 1`] = ` +
+
+ short title +
+
+ +
+ opened 7 days ago +
+
+ DanConwayDev +
+
+
+`; + +exports[`PRs/Header loading smoke-test 1`] = ` +
+
+
+
+
+
+
+
+
+
+
+
+
+
+`; diff --git a/__snapshots__/prs-list-item.test.js.snap b/__snapshots__/prs-list-item.test.js.snap index 31ed730..acbed6b 100644 --- a/__snapshots__/prs-list-item.test.js.snap +++ b/__snapshots__/prs-list-item.test.js.snap @@ -9,7 +9,9 @@ exports[`PRs/List/Item Author Loading smoke-test 1`] = ` -
+
short title
@@ -32,7 +34,7 @@ exports[`PRs/List/Item Author Loading smoke-test 1`] = `
- + `; @@ -45,7 +47,9 @@ exports[`PRs/List/Item Long Details smoke-test 1`] = ` -
+
rather long title that goes on and on and on and on and on and on...
@@ -57,7 +61,7 @@ exports[`PRs/List/Item Long Details smoke-test 1`] = ` DanConwayDev -
+ `; @@ -70,7 +74,9 @@ exports[`PRs/List/Item Long and No Spaces smoke-test 1`] = ` -
+
LongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameL...
@@ -92,7 +98,7 @@ exports[`PRs/List/Item Long and No Spaces smoke-test 1`] = ` DanConwayDev -
+ `; @@ -105,7 +111,9 @@ exports[`PRs/List/Item Short Details smoke-test 1`] = ` -
+
short title
@@ -127,7 +135,7 @@ exports[`PRs/List/Item Short Details smoke-test 1`] = ` DanConwayDev -
+ `; @@ -135,11 +143,13 @@ exports[`PRs/List/Item loading smoke-test 1`] = `
  • -
    +
    -
    +
  • `; diff --git a/__snapshots__/prs-list-list.test.js.snap b/__snapshots__/prs-list-list.test.js.snap index b2f2ab3..dc4dd9a 100644 --- a/__snapshots__/prs-list-list.test.js.snap +++ b/__snapshots__/prs-list-list.test.js.snap @@ -16,7 +16,9 @@ exports[`PRs/List/List Default smoke-test 1`] = ` -
    +
    short title
    @@ -38,7 +40,7 @@ exports[`PRs/List/List Default smoke-test 1`] = ` DanConwayDev -
    +
  • -
    +
    rather long title that goes on and on and on and on and on and on...
    @@ -60,7 +64,7 @@ exports[`PRs/List/List Default smoke-test 1`] = ` DanConwayDev
  • - +
  • -
    +
    LongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameL...
    @@ -92,7 +98,7 @@ exports[`PRs/List/List Default smoke-test 1`] = ` DanConwayDev
  • - + @@ -124,32 +130,38 @@ exports[`PRs/List/List Loading smoke-test 1`] = `
  • -
    +
    -
    +
  • -
    +
    -
    +
  • -
    +
    -
    +
  • @@ -166,7 +178,9 @@ exports[`PRs/List/List No Title smoke-test 1`] = ` -
    +
    short title
    @@ -188,7 +202,7 @@ exports[`PRs/List/List No Title smoke-test 1`] = ` DanConwayDev -
    +
  • -
    +
    rather long title that goes on and on and on and on and on and on...
    @@ -210,7 +226,7 @@ exports[`PRs/List/List No Title smoke-test 1`] = ` DanConwayDev
  • - + @@ -232,7 +248,9 @@ exports[`PRs/List/List Partially Loaded smoke-test 1`] = ` -
    +
    short title
    @@ -254,7 +272,7 @@ exports[`PRs/List/List Partially Loaded smoke-test 1`] = ` DanConwayDev -
    +
  • -
    +
    rather long title that goes on and on and on and on and on and on...
    @@ -276,17 +296,19 @@ exports[`PRs/List/List Partially Loaded smoke-test 1`] = ` DanConwayDev
  • - +
  • -
    +
    -
    +
  • diff --git a/src/lib/components/prs/PRHeader.stories.svelte b/src/lib/components/prs/PRHeader.stories.svelte new file mode 100644 index 0000000..b9617f6 --- /dev/null +++ b/src/lib/components/prs/PRHeader.stories.svelte @@ -0,0 +1,26 @@ + + + + + + + + + + + + + diff --git a/src/lib/components/prs/PRHeader.svelte b/src/lib/components/prs/PRHeader.svelte new file mode 100644 index 0000000..716d77d --- /dev/null +++ b/src/lib/components/prs/PRHeader.svelte @@ -0,0 +1,73 @@ + + + + +
    + {#if loading} +
    +
    +
    +
    +
    +
    +
    +
    + {:else} +
    + {short_title} +
    +
    + +
    + opened {created_at_ago} +
    +
    + {#if author.loading} +
    + {:else} + {author_name} + {/if} +
    +
    + {/if} +
    diff --git a/src/lib/components/prs/PRsListItem.svelte b/src/lib/components/prs/PRsListItem.svelte index bbcbb91..74489f0 100644 --- a/src/lib/components/prs/PRsListItem.svelte +++ b/src/lib/components/prs/PRsListItem.svelte @@ -4,11 +4,12 @@